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)
- co.elastic.clients.elasticsearch.ElasticsearchClient.delete responce nullpointerexception HOT 2
- Creating aggregation from json via supplied reader HOT 1
- Building a zero result response declares missing properties as mandatory which should be optional HOT 1
- `field_masking_span` is deprecated in ES8.0+ but still used in java client HOT 4
- Cannot parse DynamicTemplate mapping with unknown field HOT 5
- Encountering NoSuchMethodError when Creating Elasticsearch Client
- PutTemplateRequest - `Unknown field 'composed_of'` HOT 1
- Snowball token filter with default language breaks `indices.get()` HOT 1
- I can't disable the 'type#name' format in the deserialization of the response HOT 1
- New lightweight http layer based on JDK 11
- New http layer based on Apache HTTP 5.x
- Support for geo distance sort on nested fields HOT 2
- JsonpMappingException thrown when parsing explicitly null co.elastic.clients.elasticsearch._types.Script from Json HOT 1
- Deserilizing error calling the healthReport() method.
- AllocationRecord has no nodeRole method HOT 3
- What is the alternative to RestHighLevelClient for Spring Boot 3.3.0 and Java 21? HOT 1
- mtermvectors with artificial documents fails when deserializing response HOT 1
- mtermvectors fails when deserializing response if field_statistics is set to false HOT 1
- Update from 8.13.4 to 8.14.1 break the dynamic template creation HOT 2
- MissingRequiredPropertyException for docsRemaining property which comes as null from elasticsearch HOT 1
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.