Oh, I missed the fact you're querying on a specific field. Maybe when Sphinx
can't find the field on an index, it just ignores that part of the query?
--
Pat
On 04/06/2010, at 11:25 AM, badnaam wrote:
> In fact even a simple
>
> t = ThinkingSphinx.search("lorem", :conditions => {:article_city =>
> "xxx"}
>
> return records from Merchant model and articlemodel, instead of just
> article.
>
>
> On Jun 3, 6:15 pm, badnaam <[email protected]> wrote:
>> I have two models Merchant/Articles with teh following define index
>>
>> define_index do
>> indexes user.username, :as => :author
>> indexes subject, :as => :subject
>> indexes content, :as => :content
>> indexes article_category.category_name, :as
>> => :article_category, :facet => true
>> indexes city, :as => :article_city, :facet => true
>>
>> has created_at, updated_at
>> has article_category_id, :as => :article_category_id
>>
>> has user(:id), :as => :author
>>
>> has 'RADIANS(lat)', :as => :lat, :type => :float
>> has 'RADIANS(lng)',:as => :lng, :type => :float
>> set_property :latitude_attr => "lat"
>> set_property :longitude_attr => "lng"
>> end
>>
>> define_index do
>> indexes :name, :sortable => true
>> indexes merchant_category.category_name, :as
>> => :category, :facet => true
>> indexes :description, :as => :description
>> indexes :city, :as => :city, :facet => true
>> indexes :state, :as => :state
>> indexes :country, :as => :country
>>
>> has created_at, updated_at
>> # has :city, :as => :merchant_city
>>
>> has 'RADIANS(lat)', :as => :lat, :type => :float
>> has 'RADIANS(lng)',:as => :lng, :type => :floats
>>
>> set_property :latitude_attr => "lat"
>> set_property :longitude_attr => "lng"
>> end
>>
>> When I do this search, I am expecting to see results from Article
>> model where the city is "xxx", but I see results from Merchant model
>> too. Why is that?
>>
>> result1 = ThinkingSphinx.facets "lorem", :all_facets =>
>> true, :conditions => {:article_city => "xxx"}, :facets => [:Article]
>
> --
> 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.