molten-trunk/molten5_withgrid/vendor/plugins/acts_as_ferret/lib/shared_index.rb
# build a ferret query matching only the record with the given id and class
build a ferret query matching only the record with the given id and class
build a ferret query matching only the record with the given id and class
def query_for_record(id, class_name)
      returning bq = Ferret::Search::BooleanQuery.new do
        bq.add_query(Ferret::Search::TermQuery.new(:id,         id.to_s),    :must)
        bq.add_query(Ferret::Search::TermQuery.new(:class_name, class_name), :must)
      end
    end
def query_for_record ( id , class_name ) returning bq = Ferret :: Search :: BooleanQuery . new do bq . add_query ( Ferret :: Search :: TermQuery . new ( :id , id . to_s ) , :must ) bq . add_query ( Ferret :: Search :: TermQuery . new ( :class_name , class_name ) , :must ) end end
build a ferret query matching only the record with the given id and class
build a ferret query matching only the record with the given id and class
id
class_name