Indexing Based on Matching Rules
Chapter
11
Writing Matching Rule Plug-Ins
133
Writing the Indexer Function
The indexer function takes a single
Slapi_PBlock
argument. This function will
never be called for the same indexer object concurrently. (If you plan to manipulate
global variables, keep in mind that the server can call this function concurrently for
different indexer objects.)
The indexer function should do the following:
1.
Get the values of the following parameters:
❍
Get the indexer object from the
SLAPI_PLUGIN_OBJECT
parameter (if the
parameter is set).
❍
Get the array of values that you want indexed from the
SLAPI_PLUGIN_MR_VALUES
parameter.
2.
Generate index keys for these values, and set the
SLAPI_PLUGIN_MR_KEYS
parameter to the array of these keys.
3.
Return 0 (or the result code
LDAP_SUCCESS
) if everything completed
successfully.
The server adds or removes the keys and the corresponding values from the
appropriate indexes.
SLAPI_PLUGIN_PRIVATE
void *
(Input parameter) Pointer to any private
data originally specified in the initialization
function. (See “Writing an Initialization
Function” on page 143 for details.)
SLAPI_PLUGIN_MR_OID
char *
(Output parameter) Official matching rule
OID of the index.
SLAPI_PLUGIN_MR_INDEX_FN
void *
(function
pointer)
(Output parameter) Name of the function
called by the server to generate a list of keys
used for indexing a set of values.
SLAPI_PLUGIN_DESTROY_FN
void *
(function
pointer)
(Output parameter) Name of the function to
be called to free the indexer object.
SLAPI_PLUGIN_OBJECT
void *
(Output parameter) Pointer to the indexer
object created by your factory function.
Table 11-1
Input and Output Parameters Available to a Indexer Factory Function (Continued)
Parameter Name
Data Type
Description
Summary of Contents for NETSCAPE DIRECTORY SERVER 6.2 - GATEWAY CUSTOMIZATION
Page 1: ...Plug In Programmer s Guide Netscape Directory Server Version6 2 December 2003...
Page 18: ...18 Netscape Directory Server Plug In Programmer s Guide December 2003...
Page 56: ...56 Netscape Directory Server Plug In Programmer s Guide December 2003...
Page 112: ...112 Netscape Directory Server Plug In Programmer s Guide December 2003...
Page 168: ...Plug In API Reference 168 Netscape Directory Server Plug In Programmer s Guide December 2003...
Page 170: ...170 Netscape Directory Server Plug In Programmer s Guide December 2003...
Page 600: ...600 Netscape Directory Server Plug In Programmer s Guide December 2003...
Page 612: ...612 Netscape Directory Server Plug In Programmer s Guide December 2003...