A filter configuration file has the following format:
tag
pattern1 delimiters filter1-1 desc1-1 [scope1]
filter1-2 desc1-2 [scope2]
pattern2 delimiters filter2-1 desc2-1 [scope3]
...
This format is explained below:
"people"
... (filters for searching "person" entries) ...
"organization"
... (filters for "organization" entries) ...
pattern1 and pattern2 are regular expressions used to determine which filter is selected, based on the search criteria. For example, if you specify "^[0-9]" as the pattern for a filter, the filter is selected for all search criteria beginning with a number.
"people"
"^[0-9]" ...
delimiters specifies the delimiters used to distinguish one field from another within the search criteria. For example, if the search criteria consists of a city name and state abbreviation separated by a comma, specify "," as the delimiter.
filter1-1, filter1-2, and filter2-1 are filters. Use %v to represent the search criteria. For example, to search e-mail addresses, use the filter (mail=%v). During runtime, if the search criteria bjensen@airius.com is entered, the filter becomes (mail=bjensen@airius.com).
"people"
"^[A-Z]*," "," (&(sn=%v1)(givenName=%v2))
In this example, the delimiter is a comma. The word before the delimiter
replaces %v1 in the filter, and the word after the delimiter replaces %v2 in
the filter. If the user searches for:
Jensen, Barbara
the resulting filter is:
(&(sn=Jensen)(givenName=Barbara))
You can also specify ranges of fields. For example, to specify the values in
the first three fields, use %v1-3. To specify values from the third field to the
last field, use %v3-. To specify the value in the last field, use %v$.
desc1-1, desc1-2, and desc2-1 are phrases briefly describing the filters.
scope1, scope2, and scope3 specify the scope of each search. This field is optional and can have the values "base", "onelevel", or "subtree".
For example, the following section of a filter configuration file specifies a filter for telephone numbers and two filters for email addresses. The telephone number filter is used if the search criteria contains one or more numbers. The email filters are used if the search criteria contains an at sign (@).
"people"
"^[0-9][0-9-]*$" " " "(telephoneNumber=*%v))" "phone number ends with"
"@" " " "(mail=%v)" "email address is"
"(mail=%v*)" "email address starts with"
You should specify the filters in the order that you want them to be used. For example, if you want to apply the (mail=%v) filter before the (mail=%v*) filter, make sure that the filters appear in that order.