Handling Extensible Match FiltersChapter 11 Writing Matching Rule Plug-ins 145If the query operator is SLAPI_OP_EQUAL, the server attempts to find the keys in theindex that match the value specified in the search filter. In the case of the otherquery operators, the server attempts to find ranges of keys that match the value.Writing a Filter Factory FunctionThe filter factory function takes a single Slapi_PBlock argument. This functionshould be thread-safe. The server may call this function concurrently. (Eachincoming LDAP request is handled by a separate thread. Multiple threads may callthis function if processing multiple requests that have extensible match filters.)The filter factory function should do the following:1. Get the OID from the SLAPI_PLUGIN_MR_OID parameter and determinewhether that OID is supported by your plug-in.m If the OID is not supported, you need to return the result codeLDAP_UNAVAILABLE_CRITICAL_EXTENSION. The server will send this backto the client.m If the OID is supported, continue with this process.2. Get and check the values of the SLAPI_PLUGIN_MR_TYPE andSLAPI_PLUGIN_MR_VALUE parameters.The values of these parameters are the attribute type and value specified in theextensible match filter.3. You can also get any data that you set in the SLAPI_PLUGIN_PRIVATEparameter during initialization. See “Writing an Initialization Function,” onpage 151.4. Create a filter object, putting the following information in the object:m The official OID of the matching rule. Optional.m The attribute type specified in the filter.m The value specified in the filter.m Any additional data that you want made available to the filter indexfunction (for example, the query operator, if specified in the filter).The server will call your filter index function at a later time to extract thisinformation from the filter object.