Hi Geoff

Two thoughts thus far: store is a field, not an attribute, so that means you 
can't filter by it (the :with option). Also - is price an integer, or a 
float/decimal? If the latter, then ranges must be of the same datatype, so 
10.0..100.0 in your example.

Is there a reason for store being a field instead of an attribute?

-- 
Pat

On 28/11/2011, at 6:11 PM, Geoff Wright wrote:

> Hi all,
> 
> I discovered :with last night, being that we run an online store I've
> been looking for a while on how to send an array through to Sphinx to
> return results for a GROUP of say, Brands. Or even, using ranges for
> prices - however, I just can't seem to get it to work!
> 
>  # Sphinx index configuration
>  define_index do
>    indexes name, :sortable => true
>    indexes description
>    indexes brand, :facet => true
>    indexes feed_id, :as => :store, :facet => true
>    has :price
>    has :created_at
>  end
> 
> ^ This is my current configuration
> 
> @products = Product.search 'dress', :with => {:store => [14,15]}
> 
> ^ With the configuration in mind, when I run the above I get :
> 
>>> @products = Product.search 'dress', :with => {:store => [14,15]}
> ThinkingSphinx::SphinxError: index product_core: no such filter
> attribute 'store'
> 
> When I try to use Price Ranges, I get:
> 
>>> @products = Product.search 'dress', :with => {:price => 10..100}
> ThinkingSphinx::SphinxError: index product_core: no such filter
> attribute 'price'
> 
> I get the feeling that something in my approach is wrong. Can anyone
> point me in the right direction?
> 
> Thanks in advance
> 
> Geoff
> 
> -- 
> 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.
> 

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