What is the difference between keyword type vs. text type with keyword analyzer?

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!

1 Like

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.

4 Likes

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