-
Notifications
You must be signed in to change notification settings - Fork 260
CompletionSuggester not working because prefix is placed at wrong position in JSON #150
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
Comments
That just bit me as well. The old RHLC code passed the prefix argument to it's parent, so it ended up at the right place: public CompletionSuggestionBuilder prefix(String prefix, Fuzziness fuzziness) {
super.prefix(prefix);
this.fuzzyOptions = new FuzzyOptions.Builder().setFuzziness(fuzziness).build();
return this;
} |
This also occurs for term suggester, using client v7.16.3.
builds a request
and server returns
|
Thanks for reporting this. It's an issue in the API specification used to produce the Java code. elastic/elasticsearch-specification#1567 has been opened to solve it, and the Java client will be updated once it's fixed. |
I'm migrating from the old high-level-client and I'm having an issue with the CompletionSuggester (using 7.16.3 right now)
As the doc at https://www.elastic.co/guide/en/elasticsearch/reference/current/search-suggesters.html states, a request looks like this
As you can see the prefix is placed in front of the "completion"-object. When I use your CompletionSuggester it will place the prefix inside the "completion"-object. As a result ElasticSearch gives me this error:
[2022-02-01T14:26:53,829][ERROR][c.a.e.AuthenticationPlugin] [SAG-21X1703] org.elasticsearch.xcontent.XContentParseException: [1:257] [completion] unknown field [prefix]
Am I doing something wrong or is this a bug? The old java-client was doing it right and also placed the prefix in front of the "completion"-object.
Thank you very much!
The text was updated successfully, but these errors were encountered: