module ElasticMapper

Constants

VERSION

Public Class Methods

included(base) click to toggle source

Include all of the submodules, so that we can optinally use elasticmapper by simply including the root module.

# 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() click to toggle source

Return the index associated with the default index name.

@return [Stretcher::Index] index object.

# File lib/elastic_mapper.rb, line 31
def self.index
  ElasticMapper.server.index(index_name)
end
index_name() click to toggle source

Return the index name.

@return [String] name of index.

# File lib/elastic_mapper.rb, line 23
def self.index_name
  @@index_name
end
index_name=(index_name) click to toggle source

The index name to use for ElasticMapper. the models themselves are namespaced by a mapping names.

@param index_name [String] name of index.

# File lib/elastic_mapper.rb, line 16
def self.index_name=(index_name)
  @@index_name = index_name
end
server() click to toggle source

Return the server object associated with ElasticMapper.

@return [Stretcher::Server]

# File lib/elastic_mapper.rb, line 47
def self.server
  @@server ||= Stretcher::Server.new
end
server=(server) click to toggle source

Allow the ES server to be overriden by an instance with custom initialization.

@param server [Stretcher::Server] ES server.

# File lib/elastic_mapper.rb, line 39
def self.server=(server)
  @@server = server
end