-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Java RestHighLevelClient throws ParsingException if scroll response contains suggests #28873
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
Pinging @elastic/es-core-infra, more specifically @javanna. |
The problem here is that the returned suggestion is not keyed by its type, it should be Unfortunately, the client doesn't set such param when calling I wonder though why the search scroll endpoint return suggestions? It doesn't return aggregations, why would it return suggestions? That sounds like a bug to me, thoughts @elastic/es-search-aggs ? @xiyangliu what is the usecase for having suggestions returned as part of a search/scroll response? I think as a workaround, while we figure this out I would take out the suggestion from the initial search request. |
@javanna We ask for aggregations and suggestions in the initial search request. They can be parsed successfully from search response. However in following scroll response, aggregations are removed intentionally (this is mentioned in doc) but suggestions are retained. That's where the parsing exception happens. I guess the team is aware of the |
As a work around, we are now using low level client for scroll request and handling scroll response by ourselves. |
I am aware of where the problem is, I just don't get why suggestions would be useful in a scroll response, would you have an answer to that? We didn't expect them to be there when building the client, that is why we are not providing the Using the low-level client is quite a drastic work-around, you could just have two search requests, one for the suggestion, and another one without the suggestion to initiate the scroll. |
@javanna We use low-level client anyway for APIs that not yet implemented in high-level one (as of v5.6.8) so for us, it's not that drastic, more like a business as usual. An edge case here, however, is that we have a use for aggregations and suggesters on initial search request that creates a scroll. It's UI thing. And no, we don't need either of them when actual scroll request happens subsequently, that's why we manually remove |
We discussed this in FixIt Friday and decided that suggestions should not be part of a scroll request. |
I think we should do something about this though: be consistent with aggregations that are not being returned as part of scroll responses, hence stop returning suggestions too. |
For the record, we also said we'd like to stop allowing aggregations on the first scroll page, and instead allow users to acquire point-in-time snapshots so that they can run multiple queries against a consistent view of the index, which is the only point of allowing to run aggs and scroll on the same request today: #26472. |
Elasticsearch version (
bin/elasticsearch --version
):5.6.8
Plugins installed: []
analysis-icu
analysis-kuromoji
analysis-smartcn
JVM version (
java -version
):1.8.0_73
OS version (
uname -a
if on a Unix-like system):macOS High Sierra version10.13.3
Description of the problem including expected versus actual behavior:
Initial search response contains both aggregations and suggests. Following scroll response does not have aggregations but still has suggests. Java
RestHighLevelClient
raisesParsingException
when parsing suggests part from scroll response.Steps to reproduce:
RestHighLevelClient
to perform aSearchRequest
which has suggest and starts a scroll context.RestHighLevelClient
to perform aSearchScrollRequest
with scroll id returned from step 3.Provide logs (if relevant):
No related log
The text was updated successfully, but these errors were encountered: