Module: ElasticRecord::Model::ClassMethods
- Defined in:
- lib/elastic_record/model.rb
Instance Method Summary collapse
- #arelastic ⇒ Object
- #elastic_connection ⇒ Object
- #elastic_index ⇒ Object
- #elastic_index=(index) ⇒ Object
- #inherited(child) ⇒ Object
Instance Method Details
#arelastic ⇒ Object
27 28 29 |
# File 'lib/elastic_record/model.rb', line 27 def arelastic Arelastic::Builders::Search end |
#elastic_connection ⇒ Object
39 40 41 |
# File 'lib/elastic_record/model.rb', line 39 def elastic_connection self.elastic_connection_cache ||= ElasticRecord::Connection.new(ElasticRecord::Config.servers, ElasticRecord::Config.) end |
#elastic_index ⇒ Object
31 32 33 |
# File 'lib/elastic_record/model.rb', line 31 def elastic_index @elastic_index ||= ElasticRecord::Index.new(self) end |
#elastic_index=(index) ⇒ Object
35 36 37 |
# File 'lib/elastic_record/model.rb', line 35 def elastic_index=(index) @elastic_index = index end |
#inherited(child) ⇒ Object
17 18 19 20 21 22 23 24 25 |
# File 'lib/elastic_record/model.rb', line 17 def inherited(child) super if child < child.base_class child.elastic_index = elastic_index.dup child.elastic_index.model = child child.elastic_index.mapping_type = elastic_index.mapping_type end end |