Justin Richer
unread,Apr 5, 2011, 11:46:08 AM4/5/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to PortableContacts
We've recently had a request for presenting multiple filters on a
single request on our (internal) PoCo service. In particular, people
would like to filter on first name and last name to do fuzzy name-
search kind of stuff. The spec only defines a single set of filterBy/
filterOp/filterValue and the behavior if those are present. What I'm
wondering is how could we support multiple filters simultaneously, and
I've got a couple ideas of how to do it that I wanted to get feedback
from other folks.
The first idea is to just repeat the parameter, such as:
filterBy=name.familyName&filterOp=startswith&filterValue=ric&filterBy=name.givenName&filterOp=startswith&filterBy=jus
Within the processor, just take these as sets, in order to get two
successive filters:
filterBy=name.familyName
filterOp=startswith
filterValue=ric
filterBy=name.givenName
filterOp=startswith
filterBy=jus
This ends up giving us parallel arrays of data that we'd have to be
careful to parse appropriately. We'd also need to explicitly treat the
error conditions (such as five filterBys and only four filterOps) and
the order of filter application.
Another option would be to define some kind of demarcation to the
fields, such as comma separation in each field. This is fine for
filterBy and filterOp but falls over with filterValue, and it doesn't
solve the parallel-arrays issue above.
Has anybody figured out a way to do this yet?
-- Justin