Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

LDAP search filter - short-circuit evaluation

22 views
Skip to first unread message

Heiner Steven

unread,
Dec 4, 2002, 7:39:26 PM12/4/02
to
[If this is the wrong newsgroup, please direct me to the right one]

I have an LDAP search filter, e.g.

(|(a=c)(b=d))

which returns all entries where the attribute "a" matches "c"
or "b" matches "d".

I'd like to formulate a filter where the search would stop
if any entry matched "a=c". "b=c" should only be searched
for if there was no matching entry for "a=b".

This is similar to "short-circuit" evaluation in the
programming language C:

if ( a == c || b == d ) .....

"b==d" would not be checked if "a==c" was already true.

Is there a way to specify this behaviour with LDAP
search filters?

Heiner

--
___ _
/ __| |_ _____ _____ _ _ Heiner STEVEN <heiner...@nexgo.de>
\__ \ _/ -_) V / -_) ' \ Shell Script Programmers: visit
|___/\__\___|\_/\___|_||_| http://www.shelldorado.com/

Heiner Steven

unread,
Dec 4, 2002, 7:41:28 PM12/4/02
to

Paul Webster

unread,
Dec 6, 2002, 2:36:36 AM12/6/02
to
Heiner Steven <heiner...@nexgo.de> wrote:

>[If this is the wrong newsgroup, please direct me to the right one]
>
>I have an LDAP search filter, e.g.
>
> (|(a=c)(b=d))
>
>which returns all entries where the attribute "a" matches "c"
>or "b" matches "d".
>
>I'd like to formulate a filter where the search would stop
>if any entry matched "a=c". "b=c" should only be searched
>for if there was no matching entry for "a=b".

[b=d and a=c in above sentence rathe rthan b=c and a=bI persume]
Anyway - I suspect that this is implementation dependent. The
directory servr might choose to look at the search criteria and then
search first on the indexed attribute (perhaps b is indexed and a is
not).
I also suspect that there could be issues with handling of referrals
(or chaining in X.500) and possible sorting of results - which all
together make life difficult for implementors.


--
Rgds
Paul Webster

0 new messages