| | |
| | | cases, the SDK translates the strings and objects into the binary |
| | | representation sent to the server over the network.</para> |
| | | |
| | | <variablelist> |
| | | <para>Equality is just one of the types of comparisons available in LDAP |
| | | filters. Comparison operators include the following.</para> |
| | | |
| | | <varlistentry> |
| | | <term>=</term> |
| | | <listitem> |
| | | <para>Equality comparison, as in <literal>(sn=Jensen)</literal>.</para> |
| | | <para>This can also be used with substring matches. For example, to match |
| | | last names starting with <literal>Jen</literal>, use the filter |
| | | <literal>(sn=Jen*)</literal>. Substrings are more expensive for the |
| | | directory server to index. Substring searches therefore might not be |
| | | permitted for many attributes.</para> |
| | | </listitem> |
| | | </varlistentry> |
| | | <varlistentry> |
| | | <term><=</term> |
| | | <listitem> |
| | | <para>Less than or equal to comparison, which works |
| | | alphanumerically.</para> |
| | | </listitem> |
| | | </varlistentry> |
| | | <varlistentry> |
| | | <term>>=</term> |
| | | <listitem> |
| | | <para>Greater than or equal to comparison, which works |
| | | alphanumerically.</para> |
| | | </listitem> |
| | | </varlistentry> |
| | | <varlistentry> |
| | | <term>=*</term> |
| | | <listitem> |
| | | <para>Presence comparison. For example, to match all entries having a |
| | | <literal>userPassword</literal>, use the filter |
| | | <literal>(userPassword=*)</literal>.</para> |
| | | </listitem> |
| | | </varlistentry> |
| | | <varlistentry> |
| | | <term>~=</term> |
| | | <listitem> |
| | | <para>Approximate comparison, matching attribute values similar to the |
| | | value you specify.</para> |
| | | </listitem> |
| | | </varlistentry> |
| | | <varlistentry> |
| | | <term>[:dn][:<replaceable>oid</replaceable>]:=</term> |
| | | <listitem> |
| | | <para>Extensible match comparison. For example, |
| | | <literal>(uid:dn:=bjensen)</literal> matches entries where |
| | | <literal>uid</literal> having the value <literal>bjensen</literal> is |
| | | a component of the entry DN. |
| | | <literal>(lastLoginTime:1.3.6.1.4.1.26027.1.4.5:=-13w)</literal> matches |
| | | entries with a last login time more recent than 13 weeks.</para> |
| | | <para>You also use extensible match filters with localized values. |
| | | Directory servers like OpenDJ support a variety of internationalized |
| | | locales, each of which has an OID for collation order, such as |
| | | <literal>1.3.6.1.4.1.42.2.27.9.4.76.1</literal> for French. OpenDJ also |
| | | lets you use the language subtype, such as <literal>fr</literal>, instead |
| | | of the OID.</para> |
| | | <itemizedlist> |
| | | <para>At the end of the OID or language subtype, you further specify the |
| | | matching rule as follows:</para> |
| | | <listitem> |
| | | <para>Add <literal>.1</literal> for less than</para> |
| | | </listitem> |
| | | <listitem> |
| | | <para>Add <literal>.2</literal> for less than or equal to</para> |
| | | </listitem> |
| | | <listitem> |
| | | <para>Add <literal>.3</literal> for equal to (default)</para> |
| | | </listitem> |
| | | <listitem> |
| | | <para>Add <literal>.4</literal> for greater than or equal to</para> |
| | | </listitem> |
| | | <listitem> |
| | | <para>Add <literal>.5</literal> for greater than</para> |
| | | </listitem> |
| | | <listitem> |
| | | <para>Add <literal>.6</literal> for substring</para> |
| | | </listitem> |
| | | </itemizedlist> |
| | | </listitem> |
| | | </varlistentry> |
| | | </variablelist> |
| | | |
| | | <variablelist> |
| | | <para>You can use boolean operators to build complex filters when a single |
| | | filter comparison is not enough to express what to match.</para> |
| | | |
| | | <varlistentry> |
| | | <term>&</term> |
| | | <listitem> |
| | | <para>This binary operator matches entries that belong to the intersection |
| | | of the two component filters, for example all users named Barbara whose |
| | | last name starts with Jen, |
| | | <literal>(&(givenName=Barbara)(sn=Jen*))</literal>.</para> |
| | | </listitem> |
| | | </varlistentry> |
| | | <varlistentry> |
| | | <term>|</term> |
| | | <listitem> |
| | | <para>This binary operator matches entries that belong to the union of the |
| | | two component filters, for example all the users named Jensen or Smith, |
| | | <literal>(|(sn=Jensen)(sn=Smith))</literal>.</para> |
| | | </listitem> |
| | | </varlistentry> |
| | | <varlistentry> |
| | | <term>!</term> |
| | | <listitem> |
| | | <para>This unary operator matches entries that do not match the filter. |
| | | Use this in complex filters when you have already narrowed the scope, |
| | | for example all users named Jensen whose first name is not Barbara, |
| | | <literal>(&(sn=Jensen)(!(givenName=Barbara)))</literal>.</para> |
| | | </listitem> |
| | | </varlistentry> |
| | | </variablelist> |
| | | <xinclude:include href="../shared/table-filter-operators.xml" /> |
| | | </section> |
| | | |
| | | <section xml:id="send-search-request"> |