I have a field that's a JSON string representation and I don't need to sort or search on it. Is it correct that I should use text type instead of keyword type?
I see now that there's actually an index option on both keyword and text types. If you can disable indexing in both cases, what's the difference between keyword with index: false and text with index: false? What does one do that the other doesn't?
I've read them but I'm just confused that when index: false is set on both of them I fail to see what the difference is between a field set as text with no indexing, and a field set as keyword with no indexing. If there's no index on both, then aren't they equivalent? You can't search or sort on either in that case right? So where do they differ?
So the text field will be analysed, meaning if you have a sentence it's broken down into constituent words and have things like lowercase/stopwords applied, whereas a keyword will be retained entirely as it is.
When also applying index to false, then there's not a whole lot of difference as you can't/won't search on them. But you'd be better off using a keyword as you retain the original value and you don't do any non-needed work to it.
With a text field with index: false, what would be the purpose of the field still being analyzed/tokenized? Just curious, if it's not indexed couldn't elasticsearch just see index: false on text type and just not do any analysis/tokenization because what would be the purpose of doing so?
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.