class Elastic::Fields::Nested

Attributes

index[R]
name[R]

Public Class Methods

new(_name, _index) click to toggle source
# File lib/elastic/fields/nested.rb, line 5
def initialize(_name, _index)
  @name = _name.to_s
  @index = _index
end

Public Instance Methods

disable_mapping_inference() click to toggle source
# File lib/elastic/fields/nested.rb, line 26
def disable_mapping_inference
  # does nothing, inference is always disabled
end
freeze() click to toggle source
Calls superclass method
# File lib/elastic/fields/nested.rb, line 30
def freeze
  @index.freeze_definition
  super
end
get_field(_name) click to toggle source
# File lib/elastic/fields/nested.rb, line 39
def get_field(_name)
  @index.definition.get_field _name
end
mapping_options() click to toggle source
# File lib/elastic/fields/nested.rb, line 35
def mapping_options
  @index.definition.as_es_mapping.merge!(type: :nested)
end
merge!(_options) click to toggle source
# File lib/elastic/fields/nested.rb, line 10
def merge!(_options)
  # does nothing
end
needs_inference?() click to toggle source
# File lib/elastic/fields/nested.rb, line 18
def needs_inference?
  false
end
nested?() click to toggle source
# File lib/elastic/fields/nested.rb, line 22
def nested?
  true
end
prepare_value_for_index(_values) click to toggle source
# File lib/elastic/fields/nested.rb, line 43
def prepare_value_for_index(_values)
  _values.map { |v| @index.new(v).as_elastic_source }
end
prepare_value_for_result(_values) click to toggle source
# File lib/elastic/fields/nested.rb, line 47
def prepare_value_for_result(_values)
  formatter = Elastic::Core::SourceFormatter.new @index.definition
  _values.each { |v| formatter.format(v) }
end
select_aggregation(_from) click to toggle source
# File lib/elastic/fields/nested.rb, line 52
def select_aggregation(_from)
  nil
end
validate() click to toggle source
# File lib/elastic/fields/nested.rb, line 14
def validate
  nil
end