Skip to content
This repository was archived by the owner on Sep 21, 2021. It is now read-only.

Conversation

@oveits
Copy link
Contributor

@oveits oveits commented Nov 24, 2016

Same as in https://github.com/elastic/elasticsearch/pull/17942/files: it seems like you always need to append '.keyword' to the field for aggregation...

I am new to elasticsearch. For me, the error message I got without .keyword, namely

"reason" : "Fielddata is disabled on text fields by default. Set fielddata=true on [color] in order to load fielddata in memory by uninverting the inverted index. Note that this can however use significant memory."

seems to be misleading. At least, the proposed workaround to follow https://www.elastic.co/guide/en/elasticsearch/reference/current/fielddata.html#_enabling_fielddata_on_literal_text_literal_fields did not work for me. I tried

curl -XPUT 'localhost:9200/cars/transactions/color?pretty' -d'
{
  "properties": {
    "my_field": {
      "type":     "text",
      "fielddata": false
    }
  }
}'

I was not sure on the my_type, so I tried with PUT 'localhost:9200/cars/transactions/popular_colors as well.

Same as in https://github.com/elastic/elasticsearch/pull/17942/files: it seems like you always need to append '.keyword' to the field for aggregation...

I am new to elasticsearch. For me, the error message I got without .keyword, namely
```
"reason" : "Fielddata is disabled on text fields by default. Set fielddata=true on [color] in order to load fielddata in memory by uninverting the inverted index. Note that this can however use significant memory."
```
seems to be misleading. At least, the proposed workaround to follow https://www.elastic.co/guide/en/elasticsearch/reference/current/fielddata.html#_enabling_fielddata_on_literal_text_literal_fields did not work for me. I tried 
```
curl -XPUT 'localhost:9200/cars/transactions/color?pretty' -d'
{
  "properties": {
    "my_field": {
      "type":     "text",
      "fielddata": false
    }
  }
}'
```
I was not sure on the my_type, so I tried with ```PUT 'localhost:9200/cars/transactions/popular_colors``` as well.
oveits added a commit to oveits/elasticsearch-definitive-guide that referenced this pull request Nov 24, 2016
Same as elastic#631:

In v 5.0.1, I have found that I get following error message, if the '.keyword' is missing:
```
"reason" : "Fielddata is disabled on text fields by default. Set fielddata=true on [color] in order to load fielddata in memory by uninverting the inverted index. Note that this can however use significant memory."
```
seems to be misleading. At least, the proposed workaround to follow https://www.elastic.co/guide/en/elasticsearch/reference/current/fielddata.html#_enabling_fielddata_on_literal_text_literal_fields did not work for me. I tried 
```
With .```keyword```, it seems to work. Found via elastic/elasticsearch#17942.
@oveits
Copy link
Contributor Author

oveits commented Nov 24, 2016

I have signed the contract, as can be seen on #632. Do I need to close this request and issue it a second time?

@oveits oveits closed this Nov 24, 2016
@oveits oveits reopened this Nov 24, 2016
@oveits
Copy link
Contributor Author

oveits commented Nov 24, 2016

I have closed and reopened the pull request. Now you can see, that all checks have passed...

@danielmitterdorfer
Copy link
Member

You are right @oveits. The keyword subfield needs to be added since Elasticsearch 5 (see elastic/elasticsearch#17188). Thanks for your PR and sorry that it took so long to review. I'll merge it soon.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants