在rails中处理标记同义词的正确方法是什么? 模型称为情境,我使用acts_as_taggable_on作为标签,使用ThinkingSphinx进行搜索。
Situation.search :conditions => { :tag_name => '(synonym11 | synonym12) | (synonym21 | synonym22)' }, :match_mode => :boolean
但排名正确
答案 0 :(得分:0)
类似的东西有帮助
define_index :main_index do
# fields
indexes :title
indexes :description
indexes user.name, :as => :author
# attributes
has id, user_id, created_at, updated_at
end
define_index :tag_index do
# fields
indexes taggings.tag.name, :as => :tag_name
# attributes
has id, user_id, created_at, updated_at
set_property :wordforms => 'db/synonyms.txt'
end