Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to change enabled setting when update mapping #28070

Closed
dnhatn opened this issue Jan 4, 2018 · 6 comments
Closed

Unable to change enabled setting when update mapping #28070

dnhatn opened this issue Jan 4, 2018 · 6 comments
Labels
>bug :Search Foundations/Mapping Index mappings, including merging and defining field types Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch

Comments

@dnhatn
Copy link
Member

dnhatn commented Jan 4, 2018

Steps to reproduce

  1. Create a new index with enabled=false
curl -XPUT -H 'Content-Type:application/json' 'localhost:9200/twitter' -d '
{
  "mappings": {
    "doc": {
      "properties": {
        "session": {
          "type": "object",
          "enabled": false
        }
      }
    }
  }
}'
  1. Update mapping with enabled=true and received an acknowledgment
curl -XPOST -H 'Content-Type:application/json' 'localhost:9200/twitter/_mapping/doc' -d '
{
  "properties": {
    "session": {
      "type": "object",
      "enabled": true
    }
  }
}'
  1. Query the mapping
curl 'localhost:9200/twitter/_mapping/doc'

{"twitter":{"mappings":{"doc":{"properties":{"session":{"type":"object","enabled":false}}}}}}

I am not sure if we support updating enabled attribute but we should not acknowledge if the update does not take effect.

@dnhatn dnhatn added the :Search Foundations/Mapping Index mappings, including merging and defining field types label Jan 4, 2018
@jpountz
Copy link
Contributor

jpountz commented Jan 4, 2018

The code seems to assume this property is updateable too.

That said maybe this bug gives us an opportunity to reconsider this. Enabling a disabled object means that all sub fields indexed prior to the enablement of the object will be ignored, but not those indexed after the object has been enabled. This can make issues harder to track, and could create all kinds of weird situations, like indices that refuse to reindex with the same mappings, etc. I can't find the issue but I believe the same argument made us disallow updating the date format on date fields in the past.

@dnhatn
Copy link
Member Author

dnhatn commented Jan 4, 2018

We disallowed updating the date format in #25271.

@ywelsch
Copy link
Contributor

ywelsch commented Jan 4, 2018

@jpountz I understand your argument, but wouldn't that same logic also apply to the "dynamic" attribute then?

@jpountz
Copy link
Contributor

jpountz commented Jan 4, 2018

Indeed. true and strict are fine, but not false.

@dnhatn dnhatn added the discuss label Jan 5, 2018
@jpountz
Copy link
Contributor

jpountz commented Jan 19, 2018

We are discussing a related issue on #12366. We will come back to this one when we reach agreement on #12366.

@dnhatn
Copy link
Member Author

dnhatn commented Oct 2, 2018

Closed by #33933.

@dnhatn dnhatn closed this as completed Oct 2, 2018
@javanna javanna added the Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch label Jul 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Search Foundations/Mapping Index mappings, including merging and defining field types Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch
Projects
None yet
Development

No branches or pull requests

5 participants