[Freeipa-devel] [PATCH] search for multiple things

Simo Sorce ssorce at redhat.com
Tue Dec 11 16:19:29 UTC 2007


On Tue, 2007-12-11 at 09:14 -0500, Rob Crittenden wrote:
> There was a discussion a few weeks ago about searching for "Bill Ben" 
> not returning both Bill AND Ben records. Pete insisted that this was a 
> regression though I could find nothing in the repo history that would 
> have affected this. It could have been some uncommitted patch, I don't know.
> 
> In any case, I think this will fix it.
> 
> diff -r 7e77cf165b4a ipa-server/xmlrpc-server/funcs.py
> --- a/ipa-server/xmlrpc-server/funcs.py Mon Dec 10 21:55:12 2007 -0500
> +++ b/ipa-server/xmlrpc-server/funcs.py Tue Dec 11 09:13:12 2007 -0500
> @@ -319,8 +319,8 @@ class IPAServer:
>           gen_search_pattern = lambda word: search_pattern % {'match':word}
> 
>           # construct the giant match for all words
> -        exact_match_filter = "(&"
> -        partial_match_filter = "(&"
> +        exact_match_filter = "(|"
> +        partial_match_filter = "(|"
>           for word in criteria_words:
>               exact_match_filter += gen_search_pattern(word)
>               partial_match_filter += gen_search_pattern("*%s*" % word)

Rob I have not looked at the code that encapsulate this snippet yet, but
from the names I have the sensation that he right fix would be instead:

exact_match_filter = "(&"
partial_match_filter = "(|"

Simo.

-- 
| Simo S Sorce |
| Sr.Soft.Eng. |
| Red Hat, Inc |
| New York, NY |




More information about the Freeipa-devel mailing list