Thinking Sphinx and acts_as_taggable_on plugin

前端 未结 3 780
长情又很酷
长情又很酷 2020-12-13 22:42

I installed Sphinx and Thinking Sphinx for ruby on rails 2.3.2.

When I search without conditions search works ok. Now, what I\'d like to do is filter by tags, so, as

3条回答
  •  一生所求
    2020-12-13 23:35

    I found that simply defining the index thus:

    Class Thing < ActiveRecord::Base    
    
    acts_as_taggable
    
         define_index do
            ..other indexing...
            indexes taggings.tag.name, :as => :tags
         end
    end
    

    worked fine.

提交回复
热议问题