0

What is a proper way to handle tag synonyms in rails? Model is called Situation, I use acts_as_taggable_on for tags and ThinkingSphinx for search.

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

but with proper ranking

kakaskin
  • 1
  • 2

1 Answers1

0

something like that helps

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
sloth
  • 99,095
  • 21
  • 171
  • 219
vegeek
  • 1