Okay, what I've done for this (after quite a while) is to have
a :with_all option as well as :with... so, reworking your example:
:with_all => {:attribute => [1, 2]}
Same syntax as :with, but obviously the end results are a little
different.
Cheers
--
Pat
On 20/09/2008, at 1:39 AM, Wolf wrote:
>
> I need more than two, because I use it for finding Objects tagged with
> combinations of 1..n tags.
> So I'll stick to my dirty hack an push it into my fork until you've
> finished mulling ;)
>
> reagrds,
> Wolf
>
>
> On 19 Sep., 16:10, Pat Allan <[email protected]> wrote:
>> Hmm, well, the hackish syntax is put one in :conditions and one
>> in :with - provided it's not a multi-model search...
>>
>> No ideas on neat syntax just yet though. Will mull it over.
>>
>> --
>> Pat
>>
>> On 19/09/2008, at 2:48 PM, Wolf wrote:
>>
>>
>>
>>> I need to find all records which match :with=>{:attribute=>1}
>>> *and* :with=>{:attribute=>2}, which obviously is not possible as
>>> long
>>> as the attributes are keys of of a hash.
>>
>>> So I patched TS to also accept an array as with-option which works
>>> fine:
>>
>>> :with => [ [:attribute,1], [:attribute,2] ]
>>
>>> But I wonder if you can think of a better syntax to configure this?
>>> Maybe this?
>>
>>> :with => [ {:attribute=>1}, {:attribute=>2} ]
>>
>>> Or a completely different approach?
>>
>>> regards,
>>> Wolf
> >
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---