[SOLVED] Keyword nested field


(alexandre) #1

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,
Alex


(David Pilato) #2

yes. that is correct


(alexandre) #3

Hi,

Thanks a lot for your quick answer !

Alex


#4

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

Thanks!


(David Pilato) #5

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


(alexandre) #6

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.


#7

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


(system) #8

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