2012-08-11 48 views
0

在轨道中处理标记同义词的正确方法是什么? 模型被称为情境,我使用acts_as_taggable_on标签和ThinkingSphinx进行搜索。使用思维狮身人面像标记轨道中的同义词

Situation.search :conditions => { :tag_name => '(synonym11 | synonym12) | (synonym21 | synonym22)' }, :match_mode => :boolean 

但适当的排名

回答

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