Module: ElasticMapper
- Defined in:
- lib/elastic_mapper.rb,
lib/elastic_mapper/version.rb
Defined Under Namespace
Modules: Index, Mapping, Search Classes: MultiSearch
Constant Summary collapse
- VERSION =
"0.3.0"
Class Method Summary collapse
-
.included(base) ⇒ Object
Include all of the submodules, so that we can optinally use elasticmapper by simply including the root module.
-
.index ⇒ Stretcher::Index
Return the index associated with the default index name.
-
.index_name ⇒ String
Return the index name.
-
.index_name=(index_name) ⇒ Object
The index name to use for ElasticMapper.
-
.server ⇒ Stretcher::Server
Return the server object associated with ElasticMapper.
-
.server=(server) ⇒ Object
Allow the ES server to be overriden by an instance with custom initialization.
Class Method Details
.included(base) ⇒ Object
Include all of the submodules, so that we can optinally use elasticmapper by simply including the root module.
54 55 56 57 58 |
# File 'lib/elastic_mapper.rb', line 54 def self.included(base) base.send(:include, ElasticMapper::Mapping) base.send(:include, ElasticMapper::Index) base.send(:include, ElasticMapper::Search) end |
.index ⇒ Stretcher::Index
Return the index associated with the default index name.
31 32 33 |
# File 'lib/elastic_mapper.rb', line 31 def self.index ElasticMapper.server.index(index_name) end |
.index_name ⇒ String
Return the index name.
23 24 25 |
# File 'lib/elastic_mapper.rb', line 23 def self.index_name @@index_name end |
.index_name=(index_name) ⇒ Object
The index name to use for ElasticMapper. the models themselves are namespaced by a mapping names.
16 17 18 |
# File 'lib/elastic_mapper.rb', line 16 def self.index_name=(index_name) @@index_name = index_name end |
.server ⇒ Stretcher::Server
Return the server object associated with ElasticMapper.
47 48 49 |
# File 'lib/elastic_mapper.rb', line 47 def self.server @@server ||= Stretcher::Server.new end |
.server=(server) ⇒ Object
Allow the ES server to be overriden by an instance with custom initialization.
39 40 41 |
# File 'lib/elastic_mapper.rb', line 39 def self.server=(server) @@server = server end |