Method: Elasticsearch::Model::Indexing::ClassMethods#mapping
- Defined in:
- lib/elasticsearch/model/indexing.rb
#mapping(options = {}, &block) ⇒ Object Also known as: mappings
Defines mappings for the index
The ‘mappings` and `settings` methods are accessible directly on the model class, when it doesn’t already define them. Use the ‘__elasticsearch__` proxy otherwise.
145 146 147 148 149 150 151 152 153 154 155 156 |
# File 'lib/elasticsearch/model/indexing.rb', line 145 def mapping(={}, &block) @mapping ||= Mappings.new() @mapping..update() unless .empty? if block_given? @mapping.instance_eval(&block) return self else @mapping end end |