New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve "Fielddata is disabled on text fields by default" message #22768
Comments
There's no guarantee that there is a |
I see, maybe just give the two options then? It would be nice to mention keyword fields at least, just not to make people enable fielddata by mistake. |
Discussed in FixItFriday, we decided to rephrase the error message and mention the two options: either enable fielddata or aggregate on a field of type keyword. |
Hi @javanna is core/src/main/java/org/elasticsearch/index/mapper/TextFieldMapper.java the only file that needs to be changed for this issue? |
@IanvsPoplicola Yes indeed. |
I've opened #23841 to improve the error message for this per #22768 (comment). However, since the error can be seen when sorting as well as aggregating (and maybe in other cases too) I did not mention aggregating in the message |
Hi @colings86 , I've recently done a bit of work on this; I'd really appreciate some feedback if you could have a look at my changes! |
@IanvsPoplicola I'm not sure we need the logic to be complex here. I think always adding the message is ok. That way it makes it clear to the user whenever they see this that for text fields there are two way to aggregate or sort the data, either enable field data at the cost of using memory or use/add a keyword field. If we only show the message when the keyword sub field exists the users will not for example that they can re-index with a keyword field to solve this issue. |
Fair enough, thank you very much for the feedback! |
Fielddata is disabled on text fields by default. Set fielddata=true on [endpoints_data.uri] 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. |
Whenever you try to aggregate on a text field, you get back the following message:
That makes sense, but given that we now by default have the raw version of the field, shall we print out some suggestion like "use [field.keyword] instead"? Otherwise people may go and enable loading of fielddata instead.
The text was updated successfully, but these errors were encountered: