I am having difficulties with multiple indexes defined on different models,
but with different field_weights. For example:
brand_index.rb
ThinkingSphinx::Index.define :brand, :with => :active_record do
indexes :name
set_property :field_weights => {
:name => 5
}
end
company_index.rb
ThinkingSphinx::Index.define :company, :with => :active_record do
indexes :name
set_property :field_weights => {
:name => 10
}
end
When I execute the following query, I don't see any reference to the field
weights and I'm always getting Brand records first.
ThinkingSphinx.search('sometext', :indices => %w[brand_core company_core])
=> SELECT * FROM `brand_core`, `company_core` WHERE MATCH('sometext') AND
sphinx_deleted = 0 LIMIT 0, 20
However if I explicitly add the field weights to the search command I do
see them. This however doesn't help me with different models having
different weights.
ThinkingSphinx.search('sometext', :field_weights => { :name => 10 },
:indices => %w[brand_core company_core])
=> SELECT * FROM `brand_core`, `company_core` WHERE MATCH('sometext') AND
sphinx_deleted = 0 LIMIT 0, 20 OPTION field_weights=(name=10)
Is this no longer possible in the 3.x gem, or am I doing something wrong?
Thanks.
-Lonnie
--
You received this message because you are subscribed to the Google Groups
"Thinking Sphinx" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/thinking-sphinx?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.