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

_size does not support doc_values #11153

Closed
pickypg opened this issue May 13, 2015 · 1 comment
Closed

_size does not support doc_values #11153

pickypg opened this issue May 13, 2015 · 1 comment

Comments

@pickypg
Copy link
Member

pickypg commented May 13, 2015

Currently, if you try to create a mapping that tries to set "doc_values" : true, then it will either ignore the _size field or ignore that setting:

PUT /test
{
  "mappings": {
    "type": {
      "_size": {
        "enabled": true,
        "doc_values" : true,
        "store": true
      }, 
      "properties": {
        "field": {
          "type": "string"
        }
      }
    }
  }
}

This results in:

GET /test/_mapping
{
  "test": {
    "mappings": {
      "type": {
        "_size": {
          "enabled": true,
          "store": true
        },
        "properties": {
          "field": {
            "type": "string"
          }
        }
      }
    }
  }
}

After adding some documents, then sorting on _size, you can see that it does indeed ignore the doc values setting (rather than just not showing it set, which was unlikely):

PUT /test/type/1
{
  "field" : "value1"
}

PUT /test/type/2
{
  "field" : "value2"
}

GET /test/_search
{
  "fields": ["_size"],
  "sort": [
    {
      "_size": {
        "order": "desc"
      }
    }
  ]
}

Fielddata:

GET /_cat/fielddata?fields=*&v
id                     host        ip           node   total  _size 
2xF59inESXKOIkzK7GkavA my-hostname 192.168.1.31 Kl'rt 16.5kb 16.5kb 

This is not critical as _size must be enabled to even be used, but in that case, it would be useful to make use of doc values.

@rjernst
Copy link
Member

rjernst commented May 13, 2015

In #8143 we locked down meta fields, so even store here is no longer possible to set (it is always stored). It is important the configuration of meta fields are managed, so that we can depend on them for features. Now that doc values are enabled by default for 2.0, for non-tokenized and indexed fields, _size will have doc values when enabled.

@rjernst rjernst closed this as completed May 13, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants