rom-elasticsearch icon indicating copy to clipboard operation
rom-elasticsearch copied to clipboard

Define nested fields

Open v-kolesnikov opened this issue 6 years ago • 0 comments

https://www.elastic.co/guide/en/elasticsearch/reference/current/nested.html

Here is a workaround

schema(:my_index) do
  attribute :authors,
    Types::Object.meta(
      type: 'nested',
      properties: {
        'person_name': { 'type': 'text' }
      }
    )
end

that should be rewritten as following:

schema(:my_index) do
  attribute :authors, Types::Nested do
    attribute :person_name, Types.Text
  end
end

v-kolesnikov avatar Feb 11 '19 21:02 v-kolesnikov