module Estella::Searchable

Attributes

field_boost[RW]
indexed_fields[RW]
indexed_json[RW]

Public Class Methods

estella_query(params = {}) click to toggle source
# File lib/estella/searchable.rb, line 41
def self.estella_query(params = {})
  params.merge!(field_boost)
  params.merge!(indexed_fields: indexed_fields)
  estella_search_query.new(params).query
end
estella_search_query() click to toggle source
# File lib/estella/searchable.rb, line 47
def self.estella_search_query
  Estella::Query
end

Public Instance Methods

as_indexed_json(_options = {}) click to toggle source
# File lib/estella/searchable.rb, line 52
def as_indexed_json(_options = {})
  schema = self.class.indexed_json
  Hash[schema.keys.zip(schema.values.map { |v| v.respond_to?(:call) ? instance_exec(&v) : send(v) })]
end