Method: Elastic::Core::SourceFormatter#format

Defined in:
lib/elastic/core/source_formatter.rb

#format(_source) ⇒ Object



13
14
15
16
17
18
19
# File 'lib/elastic/core/source_formatter.rb', line 13

def format(_source)
  _source.each do |key, value|
    field = @definition.get_field key
    next if field.nil?
    _source[key] = field.prepare_value_for_result(value)
  end
end