More on Filters
In the previous sections we spent a great deal of time on filters and the syntax to build them. Although filters are incredibly powerful, the power is magnified tenfold if we can build them dynamically (at run time) using templates. Take the case of providing a user with a text field in which to type some search data. How can we form a search using this data? The user might type in a phone number, or she might type in "tony." We should choose a search filter that includes sn in one case but telephoneNumber in the other case. It would also be wasteful to use a search of the form (|(cn=searchstring) (telephoneNumber=searchstring)), since the server is comparing against extra fields that are not needed and it might return unwanted ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access