Although, you could add shoe_options(:id) as an attribute to your  
Product index, and then do a normal find for shoes that are brown and  
wide, then use the ids of those results in a filter while searching on  
Product...

Whether that's flexible enough for general use, though, is up to you.

-- 
Pat

On 31/10/2009, at 2:57 PM, Pat Allan wrote:

>
> Hi Alan
>
> There isn't really any easier ways to do what you're after... Sphinx
> has no understanding of key-value pairs, especially when it comes to
> fields, so I think your best bet is to search on ShoeOption instead.
>
> -- 
> Pat
>
> On 30/10/2009, at 7:22 AM, Alan wrote:
>
>>
>> Wondering how best to handle the following situation:
>>
>> Product has many Shoe_Option(example class name to illustrate type of
>> data model) where shoe options have the attributes of color, size and
>> width.
>>
>> I want to do a search on products that have shoe options that have
>> "brown" for color and "wide" for width.
>>
>> If I define index at the Product level(attempting to find products
>> with children that match), my result set of products is off, because
>> it will match products that might not have a child option that has
>> both brown AND wide.... It will simply match if there is a one child
>> shoe option with "wide" and at least one other child shoe option with
>> "brown".
>>
>> What I am really looking for is an individual Shoe Option with BOTH  
>> of
>> these attributes.
>>
>> Ok, so the obvious next thought would be to define the index at the
>> Shoe Option. That's great except, that it return a list of Shoe
>> Options, when I want products... Obviously I can manipulate the TS
>> result set, but I would like to do this at a lower level so there
>> isn't unnecessary processing.
>>
>> Anyone have tips on how to do this with TS? Let me know if my example
>> is not clear...
>>>
>
>
> >


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to