Skip to content

Change in index_in_parent doesn't work, but throws no error #53792

@AndyHunt66

Description

@AndyHunt66

Elasticsearch version (bin/elasticsearch --version): 6.8.6 / 7.6.0

Description:
Trying to change the value of index_in_parent seems to succeed, but doesn't.
I would expect that it is working as designed that that value cannot be changed, but I think it's a bug that no error is returned when trying to change it.

Steps to Reproduce:

PUT /parenttest
PUT /parenttest/_mapping/_doc
{
  "properties": {
    "email": {
      "type": "keyword"
    },

            "user" : {
                "type" : "nested",
                "include_in_parent": true,
                "properties": {
                    "first" : {"type": "text" },
                    "last"  : {"type": "text" }
                }
            }

  }
}
GET parenttest
PUT /parenttest/_mapping/_doc
{
  "properties": {
    "email": {
      "type": "keyword"
    },

            "user" : {
                "type" : "nested",
                "include_in_parent": false,
                "properties": {
                    "first" : {"type": "text" },
                    "last"  : {"type": "text" }
                }
            }

  }
}
GET parenttest

Expected behaviour:
The third PUT returns an error explaining that it's not possible to change the value of "include_in_parent"

Observed Behaviour:
None of the calls throws an error.
The second GET returns exactly the same data as the first.

Activity

elasticmachine

elasticmachine commented on Mar 19, 2020

@elasticmachine
Collaborator

Pinging @elastic/es-search (:Search/Mapping)

jtibshirani

jtibshirani commented on Mar 30, 2020

@jtibshirani
Contributor

Thanks @AndyHunt66 for reporting this. I agree that we should throw an error when attempting to change the values for these parameters. The alternative is to add support for changing the value. This would allow for a situation in which some documents contain the values in the parent/ root but others do not, which is a strange index state and could cause confusion when querying against these fields.

added 3 commits that reference this issue on Apr 16, 2020
5c66caf
10f0454
d7cded8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Participants

      @javanna@AndyHunt66@jtibshirani@elasticmachine

      Issue actions

        Change in `index_in_parent` doesn't work, but throws no error · Issue #53792 · elastic/elasticsearch