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

Add filtering for default index settings #30834

Closed
nikita-sheremet-java-developer opened this issue May 24, 2018 · 3 comments
Closed

Add filtering for default index settings #30834

nikita-sheremet-java-developer opened this issue May 24, 2018 · 3 comments
Labels
:Core/Infra/Settings Settings infrastructure and APIs

Comments

@nikita-sheremet-java-developer

Here is example about retriving filtered settings for index:

GET /log_2013_-*/_settings/index.number_*

With include_defaults it can return also default settings:

GET /log_2013_-*/_settings/index.number_*?include_defaults=true

But when it comes to filter default values, for exmaple index.blocks.write it returns empty responce:

GET /log_2013_-*/_settings/index.blocks.write*?include_defaults=true

Because index.blocks.write is placed in to "defaults" sectionm like that:

    {
      "settings": {
        "index": {
          "creation_date": "1527152951908",
          "number_of_shards": "5",
          "number_of_replicas": "1",
          "uuid": "_hzrBivpTZqYcZOwi-7P3g",
          "version": {
            "created": "6020099"
          },
          "provided_name": "some-7d0b0bce-de81-439a-a5de-bcdb8aaef3eb"
        }
      },
      "defaults": {
        "index": {
          ...
          "blocks": {
            "metadata": "false",
            "read": "false",
            "read_only_allow_delete": "false",
            "read_only": "false",
            "write": "false"
          },
          "max_script_fields": "32",
          ...
        }
      }
    }
@polyfractal polyfractal added the :Core/Infra/Settings Settings infrastructure and APIs label May 24, 2018
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra

@javanna
Copy link
Member

javanna commented May 28, 2018

@nikita-sheremet-java-developer which version are you on? Next time could you please include the info requested in the issue template rather than overriding it as a whole? Thank you!

I did some digging on this. Filtering of default values was recently fixed, see #29539 and #29229. Filters were previously not applied to the default settings. That lead to getting an empty response whenever a setting was not listed in the "default" section, although there would be matches in the default section. The following works now on master and 6.x (fix is due to be released with 6.4.0):

curl 'localhost:9200/_settings/index.blocks.write?include_defaults=true&pretty'
{
  "index" : {
    "settings" : { },
    "defaults" : {
      "index" : {
        "blocks" : {
          "write" : "false"
        }
      }
    }
  }
}

@javanna javanna closed this as completed May 28, 2018
@nikita-sheremet-java-developer
Copy link
Author

My version is 6.2, sorry.

Thanks you for reply.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Core/Infra/Settings Settings infrastructure and APIs
Projects
None yet
Development

No branches or pull requests

4 participants