[Freeipa-devel] search fields

Rob Crittenden rcritten at redhat.com
Mon Nov 26 21:16:44 UTC 2007


Pete Rowley wrote:
> Rob Crittenden wrote:
>> Karl MacMillan wrote:
>>> On Mon, 2007-11-26 at 14:14 -0500, Rob Crittenden wrote:
>>>> David O'Brien wrote:
>>>>> Pete Rowley wrote:
>>>>>> David O'Brien wrote:
>>>>>>> Rob Crittenden wrote:
>>>>>>>  
>>>>>>>> I have a memory of talking about this before but can't find the 
>>>>>>>> e-mails.
>>>>>>>>
>>>>>>>> I'm working on policy configuration now and setting the default 
>>>>>>>> search
>>>>>>>> fields. They are:
>>>>>>>>
>>>>>>>> users: uid,givenName,sn,telephoneNumber,ou,title
>>>>>>>> groups: cn,description
>>>>>>>>
>>>>>>>> If you want additional fields speak now :-)
>>>>>>>>
>>>>>>>> I seem to recall discussing add carLicense and displayname.
>>>>>>>>
>>>>>>>> rob
>>>>>>>>
>>>>>>>>     
>>>>>>> Is it possible to search the same field for multiple values? e.g. 
>>>>>>> I want
>>>>>>> to search for Bill and Ben, both of whom exist, but I get "No 
>>>>>>> results
>>>>>>> found for 'Bill Ben'".
>>>>>>>
>>>>>>>   
>>>>>> This should work - looks like a regression.
>>>>>>
>>>>> I created ticket #120 for this
>>>>>
>>>> I looked into this a bit. It seems that we do an AND match for each 
>>>> element and not an OR match.
>>>>
>>>> So we look for Bill AND Ben and not Bill OR Ben. I think this is to 
>>>> handle the sample case of "Joe Marketing" to search for Joe in 
>>>> Marketing.
>>>>
>>>> I can easily switch this but is it what we want? Should there be a 
>>>> switch for ALL or ANY in the UI?
>>>>
>>>
>>> Ideally the results would be all of the AND results followed by all of
>>> the OR results. Is that possible?
>>>
>>> Karl
>>>
>>
>> A question for a DS guy I think to determine performance impact, if 
>> any. I think it would be very mild since all of these attributes are 
>> indexed.
>>
>> Currently a search for "Bill Ben" looks like:
>>
>> filter="(&(objectClass=person)(&(|(uid=Bill)(givenName=Bill)(sn=Bill)
>> (telephoneNumber=Bill)(ou=Bill)(title=Bill))(|(uid=Ben)(givenName=Ben)
>> (sn=Ben)(telephoneNumber=Ben)(ou=Ben)(title=Ben))))"
>>
>> plus
>>
>> filter="(&(objectClass=person)(&(|(uid=*Bill*)(givenName=*Bill*)
>> (sn=*Bill*)(telephoneNumber=*Bill*)(ou=*Bill*)(title=*Bill*))
>> (|(uid=*Ben*)(givenName=*Ben*)(sn=*Ben*)(telephoneNumber=*Ben*)
>> (ou=*Ben*)(title=*Ben*))))"
>>
>> So complete matches first, then partial matches.
>>
>> To do an AND as well where would we put the results? All exact matches 
>> first follow by all partials?
>>
> That's how it used to work.

Ok but is it what we want? I didn't change it so I assume Kevin had some 
reasoning behind it if he did but that would be a fairly large code 
change and I can't find it at:
https://hosted.fedoraproject.org/projects/freeipa/log/ipa-server/xmlrpc-server/funcs.py

So if we want it to do both I can do a separate set of searches for each 
word and combine the results. I'm not invested in any particular method, 
just need to know how you want it to work.

The logic of this query is making my head hurt. I believe that to do 
searches for either Bill or Ben I would need to do separate searches 
that look like:

filter="(&(objectClass=person)(&((uid=Bill)(givenName=Bill)(sn=Bill)
(telephoneNumber=Bill)(ou=Bill)(title=Bill))))"
filter="(&(objectClass=person)(&(|(uid=Ben)(givenName=Ben)
(sn=Ben)(telephoneNumber=Ben)(ou=Ben)(title=Ben))))"

etc.
rob
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3245 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20071126/69ee0731/attachment.bin>


More information about the Freeipa-devel mailing list