module ElasticMapper::Mapping

Used to describe the mapping for an ActiveModel object, so that it can be indexed for search:

On The Topic of Mappings:

www.elasticsearch.org/guide/en/elasticsearch/reference/current/mapping.html

Public Class Methods

included(base) click to toggle source
# File lib/elastic_mapper/mapping.rb, line 9
def self.included(base)
  # Default the mapping name, to the table_name variable.
  # this will be set for ActiveRecord models.
  if base.respond_to?(:table_name)
    base.instance_variable_set(:@_mapping_name, base.table_name.to_sym)
  end

  base.extend(ClassMethods)
end