Module: Elasticfusion
- Defined in:
- lib/elasticfusion/search/wrapper.rb,
lib/elasticfusion/hooks.rb,
lib/elasticfusion/loader.rb,
lib/elasticfusion/version.rb,
lib/elasticfusion/definition.rb,
lib/elasticfusion/search/errors.rb,
lib/elasticfusion/search/peeker.rb,
lib/elasticfusion/model/indexing.rb,
lib/elasticfusion/model/settings.rb,
lib/elasticfusion/search/builder.rb,
lib/elasticfusion/model/searching.rb,
lib/elasticfusion/jobs/reindex_job.rb,
lib/elasticfusion/search/query/ast.rb,
lib/elasticfusion/search/query/lexer.rb,
lib/elasticfusion/search/query/parser.rb,
lib/elasticfusion/search/query/visitor.rb,
lib/elasticfusion/search/query/value_sanitizer.rb,
lib/elasticfusion/search/query/visitors/elasticsearch.rb,
lib/elasticfusion/search/query/visitors/polyadic_tree.rb
Overview
An instance of this class represents a single search. It encapsulates all custom search features (advanced query parsing, query building, etc.)
Defined Under Namespace
Modules: ActiveRecordAdapterPatch, Jobs, Model, Search
Constant Summary collapse
- VERSION =
'1.0.0'
Class Method Summary collapse
- .define(cls, &block) ⇒ Object
-
.load_index_definitions ⇒ Object
Call this method from within an autoloaded file (e.g. models/application_record.rb) to instantiate index definitions and refresh them in development, when Rails autoreloads constants.
Class Method Details
.define(cls, &block) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/elasticfusion/definition.rb', line 7 def self.define(cls, &block) cls.class_eval do include Elasticsearch::Model def self.elasticfusion(&block) @elasticfusion ||= Model::Settings.new(self, &block) end end cls.class_eval(&block) # Model extensions may rely on settings set with the block # and should only be included after evaluating it. cls.class_eval do include Model::Indexing include Model::Searching end end |
.load_index_definitions ⇒ Object
Call this method from within an autoloaded file (e.g. models/application_record.rb) to instantiate index definitions and refresh them in development, when Rails autoreloads constants.
6 7 8 |
# File 'lib/elasticfusion/loader.rb', line 6 def self.load_index_definitions Dir.glob(Rails.root.join('app', 'indexes', '*.rb'), &method(:load)) end |