Method: Elasticsearch::Model::Indexing::ClassMethods#settings
- Defined in:
- lib/elasticsearch/model/indexing.rb
permalink #settings(settings = {}, &block) ⇒ Object
Define settings for the index
You can read settings from any object that responds to :read as long as its return value can be parsed as either YAML or JSON.
199 200 201 202 203 204 205 206 207 208 209 210 211 |
# File 'lib/elasticsearch/model/indexing.rb', line 199 def settings(settings={}, &block) settings = YAML.load(settings.read) if settings.respond_to?(:read) @settings ||= Settings.new(settings) @settings.settings.update(settings) unless settings.empty? if block_given? self.instance_eval(&block) return self else @settings end end |