Hi Alan
The code you've written should work. If there's other cases where you
want to match all of the given values in each set of MVA values for a
record, then use :with_all instead of :with.
Cheers
--
Pat
On 06/11/2009, at 7:33 AM, Alan wrote:
>
> I couldn't find anything while searching the archives, but does anyone
> know if there is a way to do a MVA union(not sure if thats the best
> way to phrase it)? Basically looking for a way to match when *one* of
> the MVA values matches at least one of the values in the array.
>
> def_index
> indexes tags(:id), as :tag_ids
> end
>
> #assume one instance of model has tag ids for this instance is 4,5,6
>
> (Model.search :with=>{:tag_ids=>[1,2,3]}).size #returns 0
> (Model.search :with=>{:tag_ids=>[2,3,4]}).size #returns 1
> >
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Thinking Sphinx" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/thinking-sphinx?hl=en
-~----------~----~----~----~------~----~------~--~---