Skip to content

Add support for search pipeline in search and msearch template #18564

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

Merged
merged 5 commits into from
Jun 24, 2025

Conversation

owaiskazi19
Copy link
Member

@owaiskazi19 owaiskazi19 commented Jun 19, 2025

Description

Add support for search pipeline in msearch template

{"index":"my-nlp-index1"}
{"id":"search_template_1","params":{"play_name":"hello","from":0,"size":1}, "search_pipeline": "my_pipeline2"}
{"index":"my-nlp-index1"}
{"id":"search_template_2","params":{"play_name":"zoo","from":0,"size":1}, "search_pipeline": "my_pipeline1"}

search template

{
  "id": "search_template_2",
  "params": {
    "play_name": "zoo",
    "from": 0,
    "size": 1
  },
  "search_pipeline": "my_pipeline1"
}

Related Issues

Resolves #18508

Check List

  • Functionality includes testing.
  • API changes companion pull request created, if applicable.
  • Public documentation issue/PR created, if applicable.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@github-actions github-actions bot added discuss Issues intended to help drive brainstorming and decision making enhancement Enhancement or improvement to existing feature or request Search:Query Capabilities labels Jun 19, 2025
Copy link
Contributor

❌ Gradle check result for 7a5f6eb: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

Copy link
Contributor

❌ Gradle check result for 7a5f6eb: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

Copy link
Contributor

✅ Gradle check result for 0bdc3bd: SUCCESS

Copy link

codecov bot commented Jun 20, 2025

Codecov Report

Attention: Patch coverage is 61.53846% with 10 lines in your changes missing coverage. Please review.

Project coverage is 72.57%. Comparing base (6bf1a6d) to head (1d360cd).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...arch/script/mustache/RestSearchTemplateAction.java 0.00% 3 Missing ⚠️
...nsearch/script/mustache/SearchTemplateRequest.java 82.35% 0 Missing and 3 partials ⚠️
.../script/mustache/SearchTemplateRequestBuilder.java 0.00% 2 Missing ⚠️
...script/mustache/RestMultiSearchTemplateAction.java 66.66% 0 Missing and 1 partial ⚠️
...g/opensearch/action/search/MultiSearchRequest.java 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main   #18564      +/-   ##
============================================
- Coverage     72.75%   72.57%   -0.18%     
+ Complexity    68258    68121     -137     
============================================
  Files          5549     5549              
  Lines        313737   313761      +24     
  Branches      45506    45511       +5     
============================================
- Hits         228250   227710     -540     
- Misses        66919    67483     +564     
  Partials      18568    18568              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@owaiskazi19 owaiskazi19 marked this pull request as ready for review June 20, 2025 06:50
@owaiskazi19 owaiskazi19 requested a review from a team as a code owner June 20, 2025 06:50
@owaiskazi19 owaiskazi19 changed the title [DRAFT] Add support for search pipeline in msearch template Add support for search pipeline in msearch template Jun 20, 2025
@owaiskazi19
Copy link
Member Author

owaiskazi19 commented Jun 20, 2025

@msfroh @reta @saratvemulapalli @dbwiddis can you review this one whenever possible?

@reta
Copy link
Contributor

reta commented Jun 20, 2025

@msfroh @reta can you review this one whenever possible?

Sincere apologies @owaiskazi19 , I may get to it next week earliest

Copy link
Contributor

❌ Gradle check result for b33ef49: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

@msfroh
Copy link
Contributor

msfroh commented Jun 23, 2025

@owaiskazi19 -- for consistency with the _search and _msearch APIs, should we detect if the search_pipeline argument is a string or object? That would let folks include ad hoc pipelines in their msearch template request.

It makes it a bit more complicated, but I think it would ensure that all three APIs behave the same.

Also, do we support search pipelines on regular search template requests? I think if we're fixing msearch template, we need to address regular search templates too.

Copy link
Member

@dbwiddis dbwiddis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well documented issue and good tests that made it clear what the changes are. LGTM!

@owaiskazi19
Copy link
Member Author

owaiskazi19 commented Jun 23, 2025

for consistency with the _search and _msearch APIs, should we detect if the search_pipeline argument is a string or object? That would let folks include ad hoc pipelines in their msearch template request.

@msfroh sure, we can have a follow up on this PR to support pipeline as object. Need to enhance the parser for that. I will create a follow up issue.

Also, do we support search pipelines on regular search template requests? I think if we're fixing msearch template, we need to address regular search templates too.

That's a good point. I added support of search pipeline in search templates in 92f4fa8

Copy link
Contributor

✅ Gradle check result for 92f4fa8: SUCCESS

@owaiskazi19 owaiskazi19 requested a review from msfroh June 23, 2025 20:45
@owaiskazi19 owaiskazi19 changed the title Add support for search pipeline in msearch template Add support for search pipeline in search and msearch template Jun 23, 2025
Copy link
Contributor

❌ Gradle check result for fd44ee7: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

Copy link
Contributor

❌ Gradle check result for fd44ee7: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

Copy link
Contributor

❕ Gradle check result for fd44ee7: UNSTABLE

Please review all flaky tests that succeeded after retry and create an issue if one does not already exist to track the flaky failure.

Copy link
Contributor

❕ Gradle check result for fd44ee7: UNSTABLE

Please review all flaky tests that succeeded after retry and create an issue if one does not already exist to track the flaky failure.

Copy link
Contributor

@msfroh msfroh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, thanks a lot @owaiskazi19!

Copy link
Contributor

❕ Gradle check result for 1d360cd: UNSTABLE

Please review all flaky tests that succeeded after retry and create an issue if one does not already exist to track the flaky failure.

@dbwiddis dbwiddis merged commit 888739f into opensearch-project:main Jun 24, 2025
30 of 31 checks passed
neuenfeldttj pushed a commit to neuenfeldttj/OpenSearch that referenced this pull request Jun 26, 2025
…earch-project#18564)

* Add support for search pipeline in msearch template

Signed-off-by: Owais <[email protected]>

* Added tests

Signed-off-by: Owais <[email protected]>

* Added test for SearchTemplateRequestBuilder

Signed-off-by: Owais <[email protected]>

* Add support of search pipeline for Search Templates

Signed-off-by: Owais <[email protected]>

* Added more tests

Signed-off-by: Owais <[email protected]>

---------

Signed-off-by: Owais <[email protected]>Signed-off-by: TJ Neuenfeldt <[email protected]>
neuenfeldttj pushed a commit to neuenfeldttj/OpenSearch that referenced this pull request Jun 26, 2025
…earch-project#18564)

* Add support for search pipeline in msearch template

Signed-off-by: Owais <[email protected]>

* Added tests

Signed-off-by: Owais <[email protected]>

* Added test for SearchTemplateRequestBuilder

Signed-off-by: Owais <[email protected]>

* Add support of search pipeline for Search Templates

Signed-off-by: Owais <[email protected]>

* Added more tests

Signed-off-by: Owais <[email protected]>

---------

Signed-off-by: Owais <[email protected]>

not displaying in alpha order

Signed-off-by: TJ Neuenfeldt <[email protected]>

removed plugin stuff

Signed-off-by: TJ Neuenfeldt <[email protected]>

reverted publicapi tags and fixed tests

Signed-off-by: TJ Neuenfeldt <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discuss Issues intended to help drive brainstorming and decision making enhancement Enhancement or improvement to existing feature or request Search:Query Capabilities v3.2.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request] Support of search pipelines in multisearch template
4 participants