You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I could not find a way to do this with the current Java client, so I patched class org.opensearch.client.opensearch.core.SearchRequest to get the param added the same way it is handled for other params.
if (request.batchedReduceSize != null) {
params.put("batched_reduce_size", String.valueOf(request.batchedReduceSize));
}
if (request.searchPipeline != null) {
params.put("search_pipeline", request.searchPipeline);
}
return params;
With all applicable changes in the static builder.
What solution would you like?
I would like my forthcoming PR to be accepted to allow others to run Hybrid queries with this param also.
What alternatives have you considered?
Not really, as there are so many similar examples in the current codebase. In my patch, I made another class, HybridSearchRequest, that was essentially a copy of SearchRequest with these simple changes. I don't think this change merits a new class, I only did this to avoid more complexity with the patch.
If a new class is preferred I can do that, please advise.
Is your feature request related to a problem?
Well, the HybridSearch query, in pure DSL, can take in a search_pipeline query. This param targets a pipeline that allows a weighting of search types. Here is a reference, https://opensearch.org/docs/latest/search-plugins/neural-search-tutorial/#step-2-search-with-the-hybrid-query. Note "GET /my-nlp-index/_search**?search_pipeline=nlp-search-pipeline**"
I could not find a way to do this with the current Java client, so I patched class org.opensearch.client.opensearch.core.SearchRequest to get the param added the same way it is handled for other params.
With all applicable changes in the static builder.
What solution would you like?
I would like my forthcoming PR to be accepted to allow others to run Hybrid queries with this param also.
What alternatives have you considered?
Not really, as there are so many similar examples in the current codebase. In my patch, I made another class, HybridSearchRequest, that was essentially a copy of SearchRequest with these simple changes. I don't think this change merits a new class, I only did this to avoid more complexity with the patch.
If a new class is preferred I can do that, please advise.
Do you have any additional context?
Well again the tutorial... https://opensearch.org/docs/latest/search-plugins/neural-search-tutorial/#step-2-search-with-the-hybrid-query
The text was updated successfully, but these errors were encountered: