Indexing Based on Matching RulesChapter 11 Writing Matching Rule Plug-Ins 133Writing the Indexer FunctionThe indexer function takes a single Slapi_PBlock argument. This function willnever be called for the same indexer object concurrently. (If you plan to manipulateglobal variables, keep in mind that the server can call this function concurrently fordifferent indexer objects.)The indexer function should do the following:1. Get the values of the following parameters:m Get the indexer object from the SLAPI_PLUGIN_OBJECT parameter (if theparameter is set).m Get the array of values that you want indexed from theSLAPI_PLUGIN_MR_VALUES parameter.2. Generate index keys for these values, and set the SLAPI_PLUGIN_MR_KEYSparameter to the array of these keys.3. Return 0 (or the result code LDAP_SUCCESS) if everything completedsuccessfully.The server adds or removes the keys and the corresponding values from theappropriate indexes.SLAPI_PLUGIN_PRIVATE void * (Input parameter) Pointer to any privatedata originally specified in the initializationfunction. (See “Writing an InitializationFunction” on page 143 for details.)SLAPI_PLUGIN_MR_OID char * (Output parameter) Official matching ruleOID of the index.SLAPI_PLUGIN_MR_INDEX_FN void *(functionpointer)(Output parameter) Name of the functioncalled by the server to generate a list of keysused for indexing a set of values.SLAPI_PLUGIN_DESTROY_FN void *(functionpointer)(Output parameter) Name of the function tobe called to free the indexer object.SLAPI_PLUGIN_OBJECT void * (Output parameter) Pointer to the indexerobject created by your factory function.Table 11-1 Input and Output Parameters Available to a Indexer Factory Function (Continued)Parameter Name Data Type Description