Chapter 63. Parameters for the Matching Rule Function

The following table lists the parameters in the parameter block passed to the database matching rule function.
Parameter ID Data Type Description
SLAPI_PLUGIN_MR_OID char * Matching rule OID (if any) specified in the extensible match filter.
SLAPI_PLUGIN_MR_TYPE char * Attribute type (if any) specified in the extensible match filter.
SLAPI_PLUGIN_MR_VALUE struct berval * Value specified in the extensible match filter.
SLAPI_PLUGIN_MR_VALUES struct berval ** values Pointer to an array of berval structures containing the values of the entry's attributes that need to be indexed.
SLAPI_PLUGIN_MR_KEYS struct berval ** Keys generated for the values specified in the SLAPI_PLUGIN_MR_VALUES parameter. The server creates indexes using these keys.
SLAPI_PLUGIN_MR_FILTER_REUSABLE unsigned int * Matching rule filter that is reusable.
SLAPI_PLUGIN_MR_QUERY_OPERATOR int * Query operator used by the server to determine how to compare the keys generated from SLAPI_PLUGIN_MR_VALUES and SLAPI_PLUGIN_MR_INDEX_FN against keys in the index.
SLAPI_PLUGIN_MR_USAGE unsigned int * Specifies the intended use of the indexer object. This parameter can have one of the following values:
  • SLAPI_PLUGIN_MR_USAGE_INDEX specifies that the indexer object should be used to index entries.
  • SLAPI_PLUGIN_MR_USAGE_SORT specifies that the indexer object should be used to sort entries.
You can use this to specify different information in the indexer object or different indexer functions, based on whether the plug-in is used for indexing or sorting.
The following extended filter argument parameters are used with LDAPv3 only:
  • SLAPI_MR_FILTER_ENTRY
  • SLAPI_MR_FILTER_TYPE
  • SLAPI_MR_FILTER_VALUE
  • SLAPI_MR_FILTER_OID
  • SLAPI_MR_FILTER_DNATTRS
The following function sets all three parameters:
  • SLAPI_SEARCH_INTERNAL_PB()

63.1. Query Operators in Extensible Match Filters

The server checks the value of the SLAPI_PLUGIN_MR_QUERY_OPERATOR parameter to determine which operator is specified. The following parameters are defined values for the SLAPI_PLUGIN_MR_QUERY_OPERATOR:
Parameter ID Description
SLAPI_OP_LESS Less than (<) operator.
SLAPI_OP_LESS_OR_EQUAL Less than or equal to (<=) operator.
SLAPI_OP_EQUAL Equal to (=) operator.
SLAPI_OP_GREATER_OR_EQUAL Greater than or equal to (>=) operator.
SLAPI_OP_GREATER Greater than (>) operator.
SLAPI_OP_SUBSTRING Allows an operation to use a wildcard (*) in a search filter. When used in a table it can be stated as cn=a*, cn=*a, or cn = *a*.