Skip to content

Add KendraRankingResponseProcessor#137

Merged
msfroh merged 4 commits intoopensearch-project:mainfrom
mingshl:kendra-ranking
May 25, 2023
Merged

Add KendraRankingResponseProcessor#137
msfroh merged 4 commits intoopensearch-project:mainfrom
mingshl:kendra-ranking

Conversation

@mingshl
Copy link
Copy Markdown
Collaborator

@mingshl mingshl commented May 12, 2023

Description

Add a KendraRankingResponseProcessor to enable creating a pipeline using kendra-ranking:

In this PR, users can create a pipeline with kendra-ranking response processor, and use the pipeline for searching:

sample command:

  1. uploading documents:
curl -XPUT localhost:9200/test1/_doc/1 -d '{
  "message": "[123:1:0309/123054.737343412:ERROR:child_process_sandbox_support_impl_linux.cc(23)] FontService unique font name matching request did not receive a response.",
  "fileset": {
    "name": "syslog"
  },
  "process": {
    "name": "org.gnome.Shell.desktop",
    "pid": 1544
  },
  "@timestamp": "2020-03-09T18:00:54.000+05:30",
  "host": {
    "hostname": "bionic",
    "name": "bionic"
  }
}'  -H "Content-Type:Application/json"
  1. creating a new pipeline named test-kendra
curl -XPUT 'localhost:9200/_search/pipeline/test-kendra' --data '
{
  "description": "A pipeline to apply kendra ranking",
  "response_processors" : [
    {
      "kendra_ranking": {
        "title_field": "fileset",
        "body_field": "message",
        "doc_limit": 500
      }
    }
  ]
}' -H 'Content-Type: application/json' 
  1. searching with the new pipeline test-kendra with normal query, for example match query:
curl -XGET 'localhost:9200/test1/_search?search_pipeline=test-kendra' --data '{
  "query": {
    "match": {
      "body_field": "2020-03-09T18:00:54.000+05:30"
    }
  }
' -H 'Content-Type: application/json' 

  1. Expecting a response with re-rank outcomes.

Issues Resolved

#7158

Check List

  • New functionality includes testing.
    • All tests pass
  • New functionality has been documented.
    • New functionality has javadoc added
  • Commits are signed as per the DCO using --signoff

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.

Signed-off-by: Mingshi Liu <mingshl@amazon.com>
Signed-off-by: Mingshi Liu <mingshl@amazon.com>
@codecov
Copy link
Copy Markdown

codecov bot commented May 19, 2023

Codecov Report

Merging #137 (c1e4a0d) into main (23b5226) will increase coverage by 0.49%.
The diff coverage is 64.70%.

@@             Coverage Diff              @@
##               main     #137      +/-   ##
============================================
+ Coverage     82.05%   82.54%   +0.49%     
- Complexity      293      303      +10     
============================================
  Files            41       42       +1     
  Lines          1131     1180      +49     
  Branches        139      143       +4     
============================================
+ Hits            928      974      +46     
- Misses          127      130       +3     
  Partials         76       76              
Impacted Files Coverage Δ
...search/search/relevance/SearchRelevancePlugin.java 0.00% <0.00%> (ø)
...nking/pipeline/KendraRankingResponseProcessor.java 89.79% <89.79%> (ø)

... and 1 file with indirect coverage changes

Signed-off-by: Mingshi Liu <mingshl@amazon.com>
@msfroh msfroh merged commit a698a3c into opensearch-project:main May 25, 2023
@mingshl mingshl added the backport 2.x Backport to 2.x branch label May 25, 2023
opensearch-trigger-bot bot pushed a commit that referenced this pull request May 25, 2023
* Add KendraRankingResponseProcessor

Signed-off-by: Mingshi Liu <mingshl@amazon.com>

* Add KendraIntelligentClientTestCase

Signed-off-by: Mingshi Liu <mingshl@amazon.com>

---------

Signed-off-by: Mingshi Liu <mingshl@amazon.com>
(cherry picked from commit a698a3c)
mingshl added a commit that referenced this pull request May 25, 2023
* Add KendraRankingResponseProcessor

Signed-off-by: Mingshi Liu <mingshl@amazon.com>

* Add KendraIntelligentClientTestCase

Signed-off-by: Mingshi Liu <mingshl@amazon.com>

---------

Signed-off-by: Mingshi Liu <mingshl@amazon.com>
(cherry picked from commit a698a3c)

Co-authored-by: Mingshi Liu <113382730+mingshl@users.noreply.github.com>
@mingshl mingshl added the feature introduce a net new unit of functionality of a software system that satisfies a requirement label Jul 11, 2023
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 feature introduce a net new unit of functionality of a software system that satisfies a requirement

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants