elasticsearch-java icon indicating copy to clipboard operation
elasticsearch-java copied to clipboard

How to Reuse a “builder”

Open xiaoyu156 opened this issue 2 years ago • 3 comments

Java API client version

8.5.3

Java version

8

Elasticsearch Version

8.5.3

Problem description

When I repeat build image

xiaoyu156 avatar Mar 09 '23 06:03 xiaoyu156

Issue created 7 months ago and no comment. Reassuring. Maybe more comments will get someone's attention? Here goes nothing I guess.

I'm having this same issue as well. Why can the builder only be built once? Seems to defeat the point of builder. In the ES 7 java client code, I was using a SearchRequestBuilder and was doing searchAfter (past 10k+ docs) paging where after each search I'd just update the searchAfter value in a loop until I got to the page I needed. Can't do that now with the ES 8 java stuffs that have SearchRequest.Builder. Can at least a new method be provided like SearchRequest.Builder newBuilder = SearchRequest.Builder.of(oldBuilder)? Of course I'd rather just not be limited to building something only once. Kind of takes away a lot of freedom.

cro-magnon avatar Oct 24 '23 20:10 cro-magnon