[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: search practice




On Tue, 19 Jun 2007, Piotr Wadas wrote:

> 
> Hello,
> Using openldap 2.3.35.
> 
> I have some simpleString like "aaaBBBcccDDDeeeFFF", and I want
> to find entries, in which a specified attribute "mySearchAttr"
> has values like
> 
> entry 1:
> mySearchAttr=aaaBBBcccDD
> 
> entry 2:
> mySearchAttr=aa
> 
> entry 3:
> mySearchAttr=aaaBBBc
> 
> entry 4:
> mySearchAttr=aaaBBBcccDDDeeeFFF
> 
> and example entries which should NOT be covered by search:
> 
> entry 5:
> mySearchAttr=aaaBBBcccDDDeeeFFFgggHHH
> 
> entry 6:
> mySearchAttr=XXXyyyZZZaaaBBBcccDDDeeeFFFxxxYYYzzz
> 
> entry 7:
> mySearchAttr=XXXyyyZZZaaaBBBcccXXXyyyZZZ
> 

I guess I found it - the key is ORDERING keyword with attribute 
definition. mySearchAttr is an attribute defined in my own local.schema,
so I changed definition, adding

ORDERING caseIgnoreOrderingMatch

and reindexed directory.

Now I can use a filter like (mySearchAttr<=aaaBBBcccDDDeeeFFF) - all
attributes lexicographically less than or equal to simpleString, which
does the job - seems to work. If I'm mistaken, please correct me :) letter 
case is not important for me in this particular situation.

Regards,
Piotr