Module: ElasticMapper
- Defined in:
- lib/elastic_mapper.rb,
lib/elastic_mapper/version.rb
Defined Under Namespace
Modules: Index, Mapping, Search
Constant Summary collapse
- VERSION =
"0.0.1"
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.
53 54 55 56 57 |
# File 'lib/elastic_mapper.rb', line 53 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.
30 31 32 |
# File 'lib/elastic_mapper.rb', line 30 def self.index ElasticMapper.server.index(index_name) end |
.index_name ⇒ String
Return the index name.
22 23 24 |
# File 'lib/elastic_mapper.rb', line 22 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.
15 16 17 |
# File 'lib/elastic_mapper.rb', line 15 def self.index_name=(index_name) @@index_name = index_name end |
.server ⇒ Stretcher::Server
Return the server object associated with ElasticMapper.
46 47 48 |
# File 'lib/elastic_mapper.rb', line 46 def self.server @@server ||= Stretcher::Server.new end |
.server=(server) ⇒ Object
Allow the ES server to be overriden by an instance with custom initialization.
38 39 40 |
# File 'lib/elastic_mapper.rb', line 38 def self.server=(server) @@server = server end |