Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] Add search_pipeline query param to SearchRequest #1030

Closed
jdomkline opened this issue Jun 14, 2024 · 2 comments
Closed

[FEATURE] Add search_pipeline query param to SearchRequest #1030

jdomkline opened this issue Jun 14, 2024 · 2 comments
Labels
enhancement New feature or request untriaged

Comments

@jdomkline
Copy link

jdomkline commented Jun 14, 2024

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.

    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.

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

@jdomkline jdomkline added enhancement New feature or request untriaged labels Jun 14, 2024
@jdomkline
Copy link
Author

I see this is a dup from a ticket from 3 days ago.. closing.

@jdomkline
Copy link
Author

Dup to a tix recently added and addressed.

@jdomkline jdomkline closed this as not planned Won't fix, can't repro, duplicate, stale Jun 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request untriaged
Projects
None yet
Development

No branches or pull requests

1 participant