Hi Nick
I'm not sure what the issue is, so can you run the following in script/console:
Store.search(:conditions => {:product_names => 'chicken'}).collect { |store|
store.sphinx_attributes['product_kosher_ids']
}
This will get us the details on what Sphinx is storing for that attribute.
--
Pat
On 12/05/2010, at 11:57 AM, Nick Kezhaya wrote:
> class Store < ActiveRecord::Base
> has_many :product_stores
> has_many :products, :through => :product_stores
>
> define_index do
> indexes :name
> indexes [products(:name), products(:brand)], :as => :product_names
>
> has products(:kosher_id), :as => :product_kosher_ids
> end
> end
>
> Oddly:
>
> Store.search :conditions => { :product_names => 'chicken' }
>
> ^ This returns stores properly, but:
>
> Store.search :conditions => { :product_names => 'chicken' }, :without
> => { :product_kosher_ids => 0 }
>
> ^ Returns an empty array. I've no idea why.
>
> I know the data is present in the database.
>
> --
> 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.