Skip to content

[Search Pipelines] Support ad hoc pipelines#7253

Merged
andrross merged 5 commits intoopensearch-project:mainfrom
msfroh:ad_hoc_search_pipeline
May 6, 2023
Merged

[Search Pipelines] Support ad hoc pipelines#7253
andrross merged 5 commits intoopensearch-project:mainfrom
msfroh:ad_hoc_search_pipeline

Conversation

@msfroh
Copy link
Copy Markdown
Contributor

@msfroh msfroh commented Apr 19, 2023

Description

This change allows a search pipeline to be defined within a search request body. This will take precedence over any other search pipeline, and allows ad hoc testing of pipeline configurations before persisting the pipeline definition in cluster state.

The new search source field is gated behind the search pipelines feature flag. Also, serialization of the field is gated behind a 3.0 version check. I don't think we should backport to the 2.x branch before we release 2.7. I think we'll want to update that version check to 2.8.

Issues Resolved

#6717

Check List

  • New functionality includes testing.
    • All tests pass
  • New functionality has been documented.
    • New functionality has javadoc added
  • Commits are signed per the DCO using --signoff
  • Commit changes are listed out in CHANGELOG.md file (See: Changelog)

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
Copy link
Copy Markdown
Contributor

Gradle Check (Jenkins) Run Completed with:

@github-actions
Copy link
Copy Markdown
Contributor

Gradle Check (Jenkins) Run Completed with:

@msfroh msfroh force-pushed the ad_hoc_search_pipeline branch from bbd7c90 to 9469e77 Compare April 21, 2023 16:32
@github-actions
Copy link
Copy Markdown
Contributor

Gradle Check (Jenkins) Run Completed with:

  • RESULT: UNSTABLE ❕
  • TEST FAILURES:
      1 org.opensearch.cluster.allocation.AwarenessAllocationIT.testThreeZoneOneReplicaWithForceZoneValueAndLoadAwareness

@msfroh
Copy link
Copy Markdown
Contributor Author

msfroh commented May 3, 2023

@andrross, @reta -- you two have context on Search Pipelines. Would either of you be able to take a look at this?

This change allows a search pipeline to be defined within a search
request body. This will take precedence over any other search pipeline,
and allows ad hoc testing of pipeline configurations before persisting
the pipeline definition in cluster state.

Signed-off-by: Michael Froh <froh@amazon.com>
@msfroh msfroh force-pushed the ad_hoc_search_pipeline branch from 9469e77 to c0bdd3d Compare May 4, 2023 20:03
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented May 4, 2023

Gradle Check (Jenkins) Run Completed with:

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 4, 2023

Codecov Report

❌ Patch coverage is 80.00000% with 14 lines in your changes missing coverage. Please review.
✅ Project coverage is 70.58%. Comparing base (2646d40) to head (fbd5321).
⚠️ Report is 3342 commits behind head on main.

Files with missing lines Patch % Lines
...opensearch/search/builder/SearchSourceBuilder.java 60.00% 7 Missing and 1 partial ⚠️
...nsearch/search/pipeline/SearchPipelineService.java 80.95% 3 Missing and 1 partial ⚠️
...pensearch/search/RandomSearchRequestGenerator.java 0.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #7253      +/-   ##
============================================
- Coverage     70.60%   70.58%   -0.03%     
+ Complexity    59582    59564      -18     
============================================
  Files          4877     4878       +1     
  Lines        285806   285844      +38     
  Branches      41165    41175      +10     
============================================
- Hits         201787   201756      -31     
- Misses        67446    67516      +70     
+ Partials      16573    16572       -1     

☔ 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.

1. Create all streams in try-with-resources.
2. Keep methods in Pipeline package-private.
3. Remove spurious character in CHANGELOG.

Also, I remembered that in a future change, I'm going to call the no-op
pipeline "_none" (like when bypassing an ingest pipeline) so I should
name it "_none" from the start.

Signed-off-by: Michael Froh <froh@amazon.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented May 4, 2023

Gradle Check (Jenkins) Run Completed with:

@reta
Copy link
Copy Markdown
Contributor

reta commented May 5, 2023

@andrross mind to take a look? thank you! ;-)

- Added opensearch.internal annotation to PipelinedRequest.
- Made PipelinedRequest final.
- Removed TODO from PipelinedRequest.
- Moved changelog entry to 2.x.

Signed-off-by: Michael Froh <froh@amazon.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented May 6, 2023

Gradle Check (Jenkins) Run Completed with:

@andrross andrross merged commit c43d713 into opensearch-project:main May 6, 2023
@andrross andrross added the backport 2.x Backport to 2.x branch label May 6, 2023
@opensearch-trigger-bot
Copy link
Copy Markdown
Contributor

The backport to 2.x failed:

The process '/usr/bin/git' failed with exit code 128

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/backport-2.x
# Create a new branch
git switch --create backport/backport-7253-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 c43d7138636023315605f8a4caf91cf407c8753a
# Push it to GitHub
git push --set-upstream origin backport/backport-7253-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/backport-2.x

Then, create a pull request where the base branch is 2.x and the compare/head branch is backport/backport-7253-to-2.x.

@msfroh msfroh deleted the ad_hoc_search_pipeline branch May 8, 2023 23:12
msfroh added a commit to msfroh/OpenSearch that referenced this pull request May 9, 2023
* [Search Pipelines] Support ad hoc pipelines

This change allows a search pipeline to be defined within a search
request body. This will take precedence over any other search pipeline,
and allows ad hoc testing of pipeline configurations before persisting
the pipeline definition in cluster state.

Signed-off-by: Michael Froh <froh@amazon.com>

* Added changelog entry

Signed-off-by: Michael Froh <froh@amazon.com>

* Incorporate feedback from @reta

Resolve + transform request into PipelinedRequest, then use that to
transform the search response.

Signed-off-by: Michael Froh <froh@amazon.com>

* Incorporate more feedback from @reta

1. Create all streams in try-with-resources.
2. Keep methods in Pipeline package-private.
3. Remove spurious character in CHANGELOG.

Also, I remembered that in a future change, I'm going to call the no-op
pipeline "_none" (like when bypassing an ingest pipeline) so I should
name it "_none" from the start.

Signed-off-by: Michael Froh <froh@amazon.com>

* Incorporate feedback from @andrross

- Added opensearch.internal annotation to PipelinedRequest.
- Made PipelinedRequest final.
- Removed TODO from PipelinedRequest.
- Moved changelog entry to 2.x.

Signed-off-by: Michael Froh <froh@amazon.com>

---------

Signed-off-by: Michael Froh <froh@amazon.com>
(cherry picked from commit c43d713)
msfroh added a commit to msfroh/OpenSearch that referenced this pull request May 9, 2023
* [Search Pipelines] Support ad hoc pipelines

This change allows a search pipeline to be defined within a search
request body. This will take precedence over any other search pipeline,
and allows ad hoc testing of pipeline configurations before persisting
the pipeline definition in cluster state.

Signed-off-by: Michael Froh <froh@amazon.com>

* Added changelog entry

Signed-off-by: Michael Froh <froh@amazon.com>

* Incorporate feedback from @reta

Resolve + transform request into PipelinedRequest, then use that to
transform the search response.

Signed-off-by: Michael Froh <froh@amazon.com>

* Incorporate more feedback from @reta

1. Create all streams in try-with-resources.
2. Keep methods in Pipeline package-private.
3. Remove spurious character in CHANGELOG.

Also, I remembered that in a future change, I'm going to call the no-op
pipeline "_none" (like when bypassing an ingest pipeline) so I should
name it "_none" from the start.

Signed-off-by: Michael Froh <froh@amazon.com>

* Incorporate feedback from @andrross

- Added opensearch.internal annotation to PipelinedRequest.
- Made PipelinedRequest final.
- Removed TODO from PipelinedRequest.
- Moved changelog entry to 2.x.

Signed-off-by: Michael Froh <froh@amazon.com>

---------

Signed-off-by: Michael Froh <froh@amazon.com>
(cherry picked from commit c43d713)
kotwanikunal pushed a commit that referenced this pull request May 11, 2023
* [Search Pipelines] Support ad hoc pipelines (#7253)

* [Search Pipelines] Support ad hoc pipelines

This change allows a search pipeline to be defined within a search
request body. This will take precedence over any other search pipeline,
and allows ad hoc testing of pipeline configurations before persisting
the pipeline definition in cluster state.

Signed-off-by: Michael Froh <froh@amazon.com>

* Added changelog entry

Signed-off-by: Michael Froh <froh@amazon.com>

* Incorporate feedback from @reta

Resolve + transform request into PipelinedRequest, then use that to
transform the search response.

Signed-off-by: Michael Froh <froh@amazon.com>

* Incorporate more feedback from @reta

1. Create all streams in try-with-resources.
2. Keep methods in Pipeline package-private.
3. Remove spurious character in CHANGELOG.

Also, I remembered that in a future change, I'm going to call the no-op
pipeline "_none" (like when bypassing an ingest pipeline) so I should
name it "_none" from the start.

Signed-off-by: Michael Froh <froh@amazon.com>

* Incorporate feedback from @andrross

- Added opensearch.internal annotation to PipelinedRequest.
- Made PipelinedRequest final.
- Removed TODO from PipelinedRequest.
- Moved changelog entry to 2.x.

Signed-off-by: Michael Froh <froh@amazon.com>

---------

Signed-off-by: Michael Froh <froh@amazon.com>
(cherry picked from commit c43d713)

* Lower back-compatibility check to 2.8.0

Signed-off-by: Michael Froh <froh@amazon.com>

---------

Signed-off-by: Michael Froh <froh@amazon.com>
shiv0408 pushed a commit to Gaurav614/OpenSearch that referenced this pull request Apr 25, 2024
* [Search Pipelines] Support ad hoc pipelines

This change allows a search pipeline to be defined within a search
request body. This will take precedence over any other search pipeline,
and allows ad hoc testing of pipeline configurations before persisting
the pipeline definition in cluster state.

Signed-off-by: Michael Froh <froh@amazon.com>

* Added changelog entry

Signed-off-by: Michael Froh <froh@amazon.com>

* Incorporate feedback from @reta

Resolve + transform request into PipelinedRequest, then use that to
transform the search response.

Signed-off-by: Michael Froh <froh@amazon.com>

* Incorporate more feedback from @reta

1. Create all streams in try-with-resources.
2. Keep methods in Pipeline package-private.
3. Remove spurious character in CHANGELOG.

Also, I remembered that in a future change, I'm going to call the no-op
pipeline "_none" (like when bypassing an ingest pipeline) so I should
name it "_none" from the start.

Signed-off-by: Michael Froh <froh@amazon.com>

* Incorporate feedback from @andrross

- Added opensearch.internal annotation to PipelinedRequest.
- Made PipelinedRequest final.
- Removed TODO from PipelinedRequest.
- Moved changelog entry to 2.x.

Signed-off-by: Michael Froh <froh@amazon.com>

---------

Signed-off-by: Michael Froh <froh@amazon.com>
Signed-off-by: Shivansh Arora <hishiv@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport 2.x Backport to 2.x branch

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants