[SOLVED] Keyword nested field

Hi all,

I just upgraded from elasticsearch 2.3 to 5.0.1.

(Example with the field toto)

Before, with an analyzed field, I used to create a nested field to get a not analyzed field like toto.raw.

i just see now in 5.0.1, I dont need to do that because elasticsearch do the things for me with keyword nested field like toto.keyword.

Could you confirm am I right ? The nested field "keyword" is for the same purpose that the "raw" nested field ?

Thanks in advance,

yes. that is correct


Thanks a lot for your quick answer !


But will the field.keyword work only if the field is defined as keyword or will it work for all fields defined as text?


type keyword is needed when you want to do things like sorting, aggregations...

The field.keyword appears when you don't have the field defined on your mapping. If you need an analyzed field and the same field not analyzed, you need to create a nested field call field.raw, for example, with keyword type.

ok. That is what I currently have it as. Thanks.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.