module ElasticRecord::Searching
Public Instance Methods
elastic_relation()
click to toggle source
# File lib/elastic_record/searching.rb, line 3 def elastic_relation ElasticRecord::Relation.new(self) end
elastic_scope(name, body, &block)
click to toggle source
# File lib/elastic_record/searching.rb, line 16 def elastic_scope(name, body, &block) extension = Module.new(&block) if block singleton_class.send(:define_method, name) do |*args| relation = body.call(*args) relation = elastic_search.merge(relation) extension ? relation.extending(extension) : relation end end
elastic_search()
click to toggle source
# File lib/elastic_record/searching.rb, line 7 def elastic_search if current_elastic_search current_elastic_search.clone else elastic_relation end end
Also aliased as: es