HP-UX Directory Server 8.1 administrator guide
B.3.2 Using operators in search filters
The operators that can be used in search filters are listed in Table B-1 “Search filter operators”.
In addition to these search filters, special filters can be specified to work with a preferred language
collation order. For information on how to search a directory with international charactersets,
see “Searching an internationalized directory”.
Table B-1 Search filter operators
DescriptionOperatorSearch type
Returns entries containing attribute values that exactly match the specified
value. For example, cn=Bob Johnson
=
Equality
Returns entries containing attributes containing the specified substring. For
example, cn=Bob* cn=*Johnson cn=*John* cn=B*John. The asterisk
(*) indicates zero (0) or more characters.
=string*
string
Substring
Returns entries containing attributes that are greater than or equal to the
specified value. For example, buildingname >= alpha.
>=
Greater than or
equal to
Returns entries containing attributes that are less than or equal to the specified
value. For example, buildingname <= alpha.
<=
Less than or equal
to
Returns entries containing one or more values for the specified attribute. For
example, cn=* telephonenumber=* manager=*.
=*
Presence
Returns entries containing the specified attribute with a value that is
approximately equal to the value specified in the search filter. For example,
cn~=suret l~=san fransico could return cn=sarette l=san
francisco.
~=
Approximate
B.3.3 Using compound search filters
Multiple search filter components can be combined using Boolean operators expressed in prefix
notation as follows:
(Boolean-operator(filter)(filter)(filter)
Boolean-operator is any one of the Boolean operators listed in Table B-2 “Search filter Boolean
operators”.
Boolean operators can be combined and nested together to form complex expressions, such as:
(Boolean-operator(filter) (
(Boolean-operator(filter)(filter)))
The Boolean operators available for use with search filters include the following
Table B-2 Search filter Boolean operators
DescriptionSymbolOperator
All specified filters must be true for the statement to be true. For example,
(&(filter)(filter)(filter)...).
&
AND
At least one specified filter must be true for the statement to be true. For
example, (|(filter)(filter)(filter)...).
|
OR
The specified statement must not be true for the statement to be true. Only
one filter is affected by the NOT operator. For example, (!(filter)).
!
NOT
Boolean expressions are evaluated in the following order:
• Innermost to outermost parenthetical expressions first.
• All expressions from left to right.
B.3.4 Search filter examples
The following filter searches for entries containing one or more values for the manager attribute.
This is also known as a presence search:
B.3 LDAP search filters 561