#199
[acts_as_ferret.git] / lib / shared_index.rb
blob21cadfddef49b70af26371a919142c0d34e33f85
1 module ActsAsFerret
2   
3   class SharedIndex < LocalIndex
5     # build a ferret query matching only the record with the given id and class
6     def query_for_record(id, class_name)
7       returning bq = Ferret::Search::BooleanQuery.new do
8         bq.add_query(Ferret::Search::TermQuery.new(:id,         id.to_s),    :must)
9         bq.add_query(Ferret::Search::TermQuery.new(:class_name, class_name), :must)
10       end
11     end
13   end
14 end