Running a java elastic search query through Eclipse. Getting this error when I am testing it, and I can't find anywhere in the API that tells me how I can set this field data to true
IllegalArgumentException[Fielddata is disabled on text fields by default. Set fielddata=true on [created] in order to load fielddata in memory by uninverting the inverted index. Note that this can however use significant memory. Alternatively use a keyword field instead.]
Does anyone know how I can fix this?
In Elasticsearch 5.0,
Stringfields were broken into two -TextandKeyword. If the property is supposed to be Analyzed, you'd want to migrate yourStringfields toText, if not then migrate them toKeyword.Look into your type mapping - If you had a property like this -
You'd want to convert it to this -
Similarly, if your property was supposed to be analyzed and you had it like this-
then you'd want to convert it to this-
Details on Elasticsearch official page