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

[PROPOSAL] support rebuild or deep copy on SearchRequest.Builder

Open kdh6429 opened this issue 11 months ago • 6 comments

What/Why

What are you proposing?

Rebuild or deep copy is supported for SearchRequest.Builder. It seems tough but supported in opensearch rest client, but there seems to be no way to support it in opensearch java(refer).

What users have asked for this feature?

What problems are you trying to solve?

I want to run a query multiple times by adding only some values ​​to an already prepared SearchRequest. For example, rerun the query by dynamically changing only the index or from field value.

What is the developer experience going to be?

Create a SearchRequest based on it. And for every query, SearchRequest.Builder is recreated and all field values ​​set are put back in and built.

Are there any security considerations?

Are there any breaking changes to the API

What is the user experience going to be?

Are there breaking changes to the User Experience?

Why should it be built? Any reason not to?

What will it take to execute?

Any remaining open questions?

I wonder why you restricted SearchRequest.Builder to only build once.

kdh6429 avatar Jul 19 '23 00:07 kdh6429