What is the difference between using the keyword type vs. text type with the keyword analyzer?
E.g.
- If I need to index a guid, which would I pick?
- If i need to index a single word, which would I pick?
Thanks!
What is the difference between using the keyword type vs. text type with the keyword analyzer?
E.g.
Thanks!
The keyword
type is named after the keyword
analyzer. The idea is that single-token strings can support more things than multi-token strings and keyword
was the analyzer that made single token strings. Thus, the name.
I'd use keyword
for guids, certainly. I'd turn off doc_values
if you don't need them.
I'd probably use text
for a single word if the word is language and keyword
if the word is some kind of "flag" or "keyword" or something. If you want language analysis stuff then you want text
. If you want sorting or aggregating on it, then you want keyword
.
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
© 2020. All Rights Reserved - Elasticsearch
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant logo are trademarks of the Apache Software Foundation in the United States and/or other countries.