Skip to content

parent child example incorrect mapping #970

Open
@MarkerDave

Description

@MarkerDave

Expected Behavior

That there is an index created with a parent child relationship using the join field.

Current Behavior

When running create_index! and error is returned.

Elasticsearch::Transport::Transport::Errors::BadRequest` ([400] {"error":{"root_cause":[{"type":"mapper_parsing_exception","reason":"Root mapping definition has unsupported parameters: [author : {type=text}] [text : {type=text}] [title : {type=text}] [join_field : {type=join, relations={question=answer}}]"}],"type":"mapper_parsing_exception","reason":"Failed to parse mapping [_doc]: Root mapping definition has unsupported parameters: [author : {type=text}] [text : {type=text}] [title : {type=text}] [join_field : {type=join, relations={question=answer}}]","caused_by":{"type":"mapper_parsing_exception","reason":"Root mapping definition has unsupported parameters: [author : {type=text}] [text : {type=text}] [title : {type=text}] [join_field : {type=join, relations={question=answer}}]"}},"status":400})

Steps to Reproduce

  1. Copy question.rb, answer.rb and parent_and_child_searchable.rb from the examples folder on this repository to a Rails 4.2.11.3 project
  2. In Rails console: require "parent_and_child_searchable"
  3. In Rails console: create an question and answer
  4. In Rails console: ParentChildSearchable.create_index!
  5. Watch everything explode

Context (Environment)

Using Rails 4.2.11.3 and 6.2
Tried using Elasticsearch 7.6.2 and 7.5.2 same result for both versions
Ruby 2.6.0
gems:
elasticsearch-rails 7.1.1
elasticsearch-model 7.1.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions