What are the considerations that I should take into account while making a field as keyword?
To provide some search capabilities I need to make a text field as keyword. I am not sure if there are any performance implications of making a large text field as keyword. Can someone please tell how should I make a decision?
Thanks.
Hi Darwin,
I don't think there will be any implications because keyword fields will be indexed as it is and doesn't need any tokenization , analyzing . Go ahead if you want exact search on that field.
What search capabilities require that you index the field as keyword?
How large can the field be?
@DarwinGoyal if your text field data is large (say >10M) which is generally the case for service payloads, I would suggest to define payload as vector with offset enabled instead of using keywords. When keyword
is used for searches, you need to provide full exact text that you want to match, else your search will return 0 results.
Vector is a better approach for storing large texts as the underlying dictionary is efficient to compute it, refer: term_vector | Elasticsearch Guide [8.6] | Elastic
This blog outlines a lot of the pros and cons of approaches to indexing and searching large strings
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.