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

[Search Pipelines] Support ad hoc pipelines #7253

Merged
merged 5 commits into from
May 6, 2023

Conversation

msfroh
Copy link
Collaborator

@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
Contributor

Gradle Check (Jenkins) Run Completed with:

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

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

@msfroh
Copy link
Collaborator 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>
CHANGELOG.md Outdated Show resolved Hide resolved
@github-actions
Copy link
Contributor

github-actions bot commented May 4, 2023

Gradle Check (Jenkins) Run Completed with:

@codecov-commenter
Copy link

codecov-commenter commented May 4, 2023

Codecov Report

Merging #7253 (24be027) into main (2646d40) will decrease coverage by 0.04%.
The diff coverage is 80.00%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@             Coverage Diff              @@
##               main    #7253      +/-   ##
============================================
- Coverage     70.60%   70.56%   -0.04%     
+ Complexity    59582    59489      -93     
============================================
  Files          4877     4878       +1     
  Lines        285806   285844      +38     
  Branches      41165    41175      +10     
============================================
- Hits         201787   201713      -74     
- Misses        67446    67460      +14     
- Partials      16573    16671      +98     
Impacted Files Coverage Δ
...pensearch/search/RandomSearchRequestGenerator.java 94.87% <0.00%> (-0.99%) ⬇️
...opensearch/search/builder/SearchSourceBuilder.java 68.02% <60.00%> (-1.16%) ⬇️
...nsearch/search/pipeline/SearchPipelineService.java 83.15% <80.95%> (+0.54%) ⬆️
...pensearch/action/search/TransportSearchAction.java 71.21% <100.00%> (+1.58%) ⬆️
.../java/org/opensearch/search/pipeline/Pipeline.java 84.61% <100.00%> (+3.13%) ⬆️
...g/opensearch/search/pipeline/PipelinedRequest.java 100.00% <100.00%> (ø)

... and 504 files with indirect coverage changes

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
Contributor

github-actions bot commented May 4, 2023

Gradle Check (Jenkins) Run Completed with:

@reta
Copy link
Collaborator

reta commented May 5, 2023

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

CHANGELOG.md Outdated Show resolved Hide resolved
- 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
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
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
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants