Feature request -->
High level REST client allows you to set the .from option in SearchSourceBuilder when using SearchScrollRequest but that return ActionRequestValidationException on runtime. The feature request is an api fix so that it does not allow to build a query that will not pass the validation in the runtime.
Example of code that throw ActionRequestValidationException
final Scroll scroll = new Scroll(TimeValue.timeValueMinutes(1L));
SearchRequest scrollSearchRequest = new SearchRequest("xxx_listing_read");
SearchSourceBuilder scrollSearchSourceBuilder = new SearchSourceBuilder();
BoolQueryBuilder queryBuilder = boolQuery();
scrollSearchSourceBuilder
.query(queryBuilder)
.from(offset)
.size(perPage);
scrollSearchRequest.source(scrollSearchSourceBuilder);
scrollSearchRequest.scroll(scroll);
Pinging @elastic/es-core-features
Hi guys, I would like to tackle this one as my first contribution to ES. I assume it is ready to be fixed, right? Or do I need to wait for some clarifications from core team?
Update:
@hub-cap according to this test throwing ActionRequestValidationException is expected.
You are correct @9deniz , as per 4ff12c9a0b73cc4345beba91d0153232b3d6b035, this is not possible. Maybe @cbuescher can shed some light here if more questions are had by @domer-sz on the subject.
Also, thank you for helping triage this @9deniz, I totally missed that this is the case when I read over it!
Hey, I understand the exception is expected in this situation. The purpose of my request was to make sure you can't design an api in such a way that you can't create a request that won't be executed correctly in runtime.
Pinging @elastic/es-search
@domer-sz ok thats perfectly acceptable. I will relabel it so it does not pertain to the high level rest client, and instead let the proper people know. Ill also edit the issue a bit so its more descriptive to search
Actually I misread your point at first, ill remove the search label :) Let me see if its possible to do that with this API currently, since its a generic API that many things can be added to.
We have decided to close this issue for now without merging and will revisit it once the high level rest client has its own pojos and builders. This is something we will be doing down the road, but we dont have a timeframe on when it will be finished.