String search withmultiple words using or not and
"John P. Rouillard" <[email protected]>
| Newsgroups | gmane.comp.bug-tracking.roundup.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi all:
If I am reading the code correctly, the filter() function in the
hyperdb treats lists of items differently.
IF the item to be searched is a string, the target string must match
all of the strings in the list. If the thing to be searched is a
link/multilink a match on any one of the items in the list is
sufficient.
From filter() in backends/rdbms_common.py:
The filter must match all properties specificed. If the property
value to match is a list:
1. String properties must match all elements in the list, and
2. Other properties must match any of the elements in the list.
This came up because I am trying to search the role property of users
for two roles: Admin and Agent. If either role is present, I want the
user entry to be returned. However (after an enhancement to support
multiple filters with the same name) using:
curl -u admin:admin 'https://....net/demo/rest/data/user?@fields=roles,username&roles=Agent&roles=Admin'
I only get a user that has both roles. Users with just one of the
roles are not returned.
I think Ralf mentioned this as a problem at one point, but I can't
find the email thread where this was discussed.
Does anybody have any ideas here? Am I missing something?
Also as an aside, I plan on releasing 1.6.1 on Saturday.
Have a great week all.
--
-- rouilj
John Rouillard
===========================================================================
My employers don't acknowledge my existence much less my opinions.