module EsSearchable::ClassMethods

Public Instance Methods

client() click to toggle source
# File lib/es_searchable.rb, line 27
def client
        @client ||= Elasticsearch::Client.new(EsSearchable.options.slice(
                :log, :retry_on_failure, :reload_on_failure, :hosts, :logger
        ))
end
es_collection() click to toggle source
# File lib/es_searchable.rb, line 19
def es_collection
        @es_collection = SearchCollection.new(self)
end
es_index(index) click to toggle source
# File lib/es_searchable.rb, line 37
def es_index(index)
        @index = index
end
handle_es_response(es_coll) click to toggle source
# File lib/es_searchable.rb, line 23
def handle_es_response(es_coll)
        es_coll
end
index() click to toggle source
# File lib/es_searchable.rb, line 41
def index
        @index ||= self.name.demodulize.downcase.pluralize
end
method_missing(meth, *args, &blk) click to toggle source
Calls superclass method
# File lib/es_searchable.rb, line 45
def method_missing(meth, *args, &blk)
        case meth
        when /(.*)_(gt|lt|gte|lte|between|like)/
                es_collection.send(meth, *args, &blk)
        else
                super
        end
end