Comments (6)
Thanks for the feedback @gquintana.
I'm a bit confused by the first part of your question, which is a search request (it accepts a scroll
duration but not a scroll_id
) whereas the code in the second one is about clearing a scroll context.
For the second part there is indeed an issue in the way Elasticsearch interprets the request that was sent by the client. And this is fixed in the main
and 7.16
branches.
If you're interested in the details: the clear scroll request accepts scroll_id
both as a path segment and as a body property. In the java client version 7.15, the id is sent in the path with an empty object as the body. When a body is present (even if an empty object), Elasticsearch reads the scroll_id
in the body and ignores the one in the path.
We've changed the code generation to prioritize body properties when a parameter exists both on the url and in the body. This solves the issue for this API and also for others. The change will be available in the 7.16.0-SNAPSHOT version starting tomorrow.
We still have a remaining issue with this endpoint: Elasticsearch returns 404 with a valid response when no scroll context is cleared. The client will then try to parse the 404 response as an error and fail to do so. We're working on fixing this too and I'll update this issue.
Thanks again for your feedback!
from elasticsearch-java.
Thanks for you answer @swallez .
I'll try to make myself clearer. AFAIK, there are 3 parts when using scroll API:
- Run standard query with scroll time out and get a scroll Id along with the first page of results
- Use the scroll id to get the next page of results, again and again until the end
- USe the scroll id to close the scroll (usefull for error handling on client side) and free up resources on ES server side
I tried to implement the 3 parts with this API
- Is alright
- Couldn't find how to implement it -> first part of the question https://www.elastic.co/guide/en/elasticsearch//reference/7.12/scroll-api.html#scroll-api
- Raises an exception -> second part of the question
from elasticsearch-java.
So right now, since only a "scroll" duration can be specified when building the search request and no way to set the scrollId
after getting the first page of results, we'd have to use the REST client correct?
from elasticsearch-java.
@mindscratch correct, the _search/scroll
API endpoint is missing in version 7.15 of the java client. Is has been added in the upcoming 7.16.
Furthermore the issues reported by @gquintana have been solved too (see test).
For the nasty details, this came from the fact that in this API endpoint Elasticsearch will ignore the scroll_id
request parameter when there is a body, even if doesn't contain a scroll_id
property. And we were sending the request parameter with an empty body, hence this error. We've now send scroll_id
as a request body property and Elasticsearch is happy 😉
from elasticsearch-java.
@swallez thanks for the follow-up, is there an ETA for when the 7.16.0 version will be released?
from elasticsearch-java.
@mindscratch I can't give an exact date, but it should be out in the next two weeks!
from elasticsearch-java.
Related Issues (20)
- GetSource API throws TransportException HOT 1
- Failed to decode response on synonyms.putSynonym HOT 1
- _custom query object is not serializing correctly and seems to be using .toString() on objects
- Missing required property 'ExecutePolicyResponse.status' while while executing enrich policy HOT 2
- ElasticSearch 8.12.1 with HighLevelRestClient/JavaClient combination not working HOT 4
- indices.get() throws transport exception when fetching indices that have a dense_vector mapping with no dims HOT 1
- How to create parent-child documents according to Java API? HOT 3
- The DateHistogramAggregation fails when adding the field 'name' HOT 2
- {"error":"Content-Type header [application/vnd.elasticsearch+json; compatible-with=8] is not supported","status":406} HOT 1
- sourcesIncludes and sourcesExcludes is missing on SearchRequest HOT 2
- Required parameter K in KnnQuery HOT 6
- Inconsistent type for IndexTemplate priority HOT 2
- UpdateOperation didn't serialize the script into the request body. HOT 2
- Allow custom SpanQuery HOT 3
- I can't provide a set of synonyms when creating the analyzer HOT 7
- On the issue of termvectors queries
- Regarding termvectors query related issues HOT 1
- PutSynonymResponse: Failed to decode response HOT 2
- TermsBucketBase: doc_count_error should be doc_count_error_upper_bound HOT 1
- Read By Id: Failed to decode response
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from elasticsearch-java.