module ElasticRecord::PercolatorModel::ClassMethods

Constants

DEFAULT_PERCOLATOR_MAPPING

Public Instance Methods

elastic_index() click to toggle source
# File lib/elastic_record/percolator_model.rb, line 18
def elastic_index
  @elastic_index ||= begin
    index = ElasticRecord::Index.new(self)
    index.mapping = DEFAULT_PERCOLATOR_MAPPING
    index.mapping = percolates_model.elastic_index.mapping
    index.settings = percolates_model.elastic_index.settings
    index.partial_updates = false
    index
  end
end
percolate(document) click to toggle source
# File lib/elastic_record/percolator_model.rb, line 29
def percolate(document)
  query = Arelastic::Queries::Percolate.new("query", document)

  elastic_search.filter(query).limit(5000)
end