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 Ability to Select a Search Pipeline in Comparison Tool #352

Merged
merged 13 commits into from
Jan 26, 2024

Conversation

nung22
Copy link
Contributor

@nung22 nung22 commented Nov 27, 2023

Description

Gives users the ability to integrate search pipelines into their queries when using Search Relevance. Pipelines are available to select under a new dropdown menu labeled Pipeline. The choices are sorted alphabetically by their name and selecting one is optional. Users are able to compare two different queries using the same or different search pipelines.

Ran these queries in Dev Tools to create the search pipelines shown in the example:

PUT /_search/pipeline/a_pipeline 
{
  "response_processors": [
    {
      "rename_field": {
        "field": "FlightNum",
        "target_field": "NewFlightNum"
      }
    }
  ]
}
PUT /_search/pipeline/b_pipeline 
{
  "request_processors": [
    {
      "filter_query" : {
        "tag" : "tag1",
        "description" : "This processor is going to restrict to documents with OpenSearch Dashboards Airlines",
        "query" : {
          "term": {
            "Carrier": "OpenSearch Dashboards Airlines"
          }
        }
      }
    }
  ]
}
PUT /_search/pipeline/c_pipeline 
{
  "request_processors": [
    {
      "filter_query" : {
        "tag" : "tag2",
        "description" : "This processor is going to restrict to documents with Thunder and Lighting as its Origin Weather",
        "query" : {
          "term": {
            "OriginWeather": "Thunder & Lightning"
          }
        }
      }
    }
  ]
}

Issues Resolved

Closes #260

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.

Screenshots

No indices or pipelines selected

issue-260-pic1

No pipeline selected

issue-260-pic2

Pipeline applied to one query

issue-260-pic3

Different pipeline applied to each query

issue-260-pic4

In action

issue-260-gif1

Signed-off-by: Nicholas Ung <nicholasung22@gmail.com>
Signed-off-by: Nicholas Ung <nicholasung22@gmail.com>
Signed-off-by: Nicholas Ung <nicholasung22@gmail.com>
Signed-off-by: Nicholas Ung <nicholasung22@gmail.com>
Signed-off-by: Nicholas Ung <nicholasung22@gmail.com>
Signed-off-by: Nicholas Ung <nicholasung22@gmail.com>
Signed-off-by: Nicholas Ung <nicholasung22@gmail.com>
* Add id to search bar

Signed-off-by: Nicholas Ung <nicholasung22@gmail.com>

* Add keys to getDlTmpl component

Signed-off-by: Nicholas Ung <nicholasung22@gmail.com>

* Change enclosing tag to span instead of div

Signed-off-by: Nicholas Ung <nicholasung22@gmail.com>

---------

Signed-off-by: Nicholas Ung <nicholasung22@gmail.com>
@nung22 nung22 changed the title Add Ability to Select a Search Pipeline in Comparison Tool Feature: Add Ability to Select a Search Pipeline in Comparison Tool Nov 30, 2023
Signed-off-by: Nicholas Ung <nicholasung22@gmail.com>
Signed-off-by: Nicholas Ung <nicholasung22@gmail.com>
Copy link

codecov bot commented Dec 13, 2023

Codecov Report

Attention: 5 lines in your changes are missing coverage. Please review.

Comparison is base (c2f175b) 83.54% compared to head (765cf71) 83.13%.

Files Patch % Lines
...search_components/search_configs/search_config.tsx 50.00% 3 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #352      +/-   ##
==========================================
- Coverage   83.54%   83.13%   -0.42%     
==========================================
  Files          32       32              
  Lines         395      415      +20     
  Branches       77       81       +4     
==========================================
+ Hits          330      345      +15     
- Misses         45       49       +4     
- Partials       20       21       +1     
Flag Coverage Δ
dashboards-search-relevance 83.13% <61.53%> (-0.42%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

Signed-off-by: Nicholas Ung <nicholasung22@gmail.com>
Signed-off-by: Nicholas Ung <nicholasung22@gmail.com>
@noCharger
Copy link
Collaborator

Approve for no compile issue

@sejli sejli merged commit 29e5867 into opensearch-project:main Jan 26, 2024
github-actions bot added a commit that referenced this pull request Jan 26, 2024
…352)

* Add search pipeline parameters to index and route files

Signed-off-by: Nicholas Ung <nicholasung22@gmail.com>

* Add search pipeline dropdown

Signed-off-by: Nicholas Ung <nicholasung22@gmail.com>

* Integrate option to select search pipeline

Signed-off-by: Nicholas Ung <nicholasung22@gmail.com>

* Update tests and snapshots

Signed-off-by: Nicholas Ung <nicholasung22@gmail.com>

* Update get pipelines endpoint

Signed-off-by: Nicholas Ung <nicholasung22@gmail.com>

* Update .babelrc

Signed-off-by: Nicholas Ung <nicholasung22@gmail.com>

* Update test snapshots

Signed-off-by: Nicholas Ung <nicholasung22@gmail.com>

* Add id attribute to search bar (#338)

* Add id to search bar

Signed-off-by: Nicholas Ung <nicholasung22@gmail.com>

* Add keys to getDlTmpl component

Signed-off-by: Nicholas Ung <nicholasung22@gmail.com>

* Change enclosing tag to span instead of div

Signed-off-by: Nicholas Ung <nicholasung22@gmail.com>

---------

Signed-off-by: Nicholas Ung <nicholasung22@gmail.com>

* Update .babelrc

Signed-off-by: Nicholas Ung <nicholasung22@gmail.com>

* Add ability to select _none option

Signed-off-by: Nicholas Ung <nicholasung22@gmail.com>

* Update test coverages

Signed-off-by: Nicholas Ung <nicholasung22@gmail.com>

* Update variables in pipeline selection

Signed-off-by: Nicholas Ung <nicholasung22@gmail.com>

---------

Signed-off-by: Nicholas Ung <nicholasung22@gmail.com>
(cherry picked from commit 29e5867)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
sejli pushed a commit that referenced this pull request Jan 26, 2024
…352) (#362)

* Add search pipeline parameters to index and route files



* Add search pipeline dropdown



* Integrate option to select search pipeline



* Update tests and snapshots



* Update get pipelines endpoint



* Update .babelrc



* Update test snapshots



* Add id attribute to search bar (#338)

* Add id to search bar



* Add keys to getDlTmpl component



* Change enclosing tag to span instead of div



---------



* Update .babelrc



* Add ability to select _none option



* Update test coverages



* Update variables in pipeline selection



---------


(cherry picked from commit 29e5867)

Signed-off-by: Nicholas Ung <nicholasung22@gmail.com>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
@nung22 nung22 deleted the feature/issue-260 branch January 30, 2024 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

[FEATURE] Add Ability to Select a Search Pipeline in Comparison Tool
3 participants