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

Creates the Kendra plugin section in Compare Search Results #2060

Merged
merged 2 commits into from
Jan 9, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 58 additions & 2 deletions _search-plugins/search-relevance/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Alternatively, you can add sample data in OpenSearch Dashboards using the follow
1. Select **Add sample data**.
1. Choose one of the built-in datasets and select **Add data**.

## Using search relevance in OpenSearch Dashboards
## Using Compare Search Results in OpenSearch Dashboards
natebower marked this conversation as resolved.
Show resolved Hide resolved

To compare search results in OpenSearch Dashboards, perform the following steps.

Expand Down Expand Up @@ -98,4 +98,60 @@ Setting `size` to a high value (for example, larger than 250 documents) may degr
{: .note}

You cannot save a given comparison for future use, so Compare Search Results is not suitable for systematic testing.
{: .note}
{: .note}

## Comparing OpenSearch search results with re-ranked results

One use case of Compare Search Results is to compare raw OpenSearch results with the same results processed by a re-ranking application. An example of such a re-ranker is **Kendra Intelligent Ranking for OpenSearch**, contributed by the Amazon Kendra team. This plugin takes search results from OpenSearch and applies Kendra’s semantic relevance rankings calculated using vector embeddings and other semantic search techniques. For many applications, this gives better result rankings.
natebower marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
One use case of Compare Search Results is to compare raw OpenSearch results with the same results processed by a re-ranking application. An example of such a re-ranker is **Kendra Intelligent Ranking for OpenSearch**, contributed by the Amazon Kendra team. This plugin takes search results from OpenSearch and applies Kendra’s semantic relevance rankings calculated using vector embeddings and other semantic search techniques. For many applications, this gives better result rankings.
One use case for Compare Search Results is to compare raw OpenSearch results with the same results processed by a re-ranking application. An example of such a re-ranker is **Kendra Intelligent Ranking**, contributed by the Amazon Kendra team. This plugin takes search results from OpenSearch and applies Amazon Kendra’s semantic relevance rankings calculated using vector embeddings and other semantic search techniques. For many applications, this provides better result rankings.


To try Kendra Intelligent Ranking, you must first set up the Amazon Kendra service. To get started, see [Amazon Kendra](https://aws.amazon.com/kendra/). For detailed information, including plugin setup instructions, see [Intelligently ranking OpenSearch (self managed) results using Amazon Kendra](https://docs.aws.amazon.com/kendra/latest/dg/opensearch-rerank.html).

Once you've set up Kendra Intelligent Ranking, enter a query in **Query 1** and the same query using the Kendra Intelligent Ranking service for re-ranking in **Query 2**. Then compare search results from OpenSearch and Amazon Kendra.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
Once you've set up Kendra Intelligent Ranking, enter a query in **Query 1** and the same query using the Kendra Intelligent Ranking service for re-ranking in **Query 2**. Then compare search results from OpenSearch and Amazon Kendra.
Once you've set up Kendra Intelligent Ranking, enter a query in **Query 1** and enter the same query using the Kendra Intelligent Ranking service for re-ranking in **Query 2**. Then compare the search results from OpenSearch and Amazon Kendra.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Can this read "...and enter the same query using Kendra Intelligent Ranking in Query 2."?


### Example

The following example searches for the text "snacking nuts" in the `abo` index. The documents in the index hold snack descriptions in the `bullet_point` array.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
The following example searches for the text "snacking nuts" in the `abo` index. The documents in the index hold snack descriptions in the `bullet_point` array.
The following example searches for the text "snacking nuts" in the `abo` index. The documents in the index contain snack descriptions in the `bullet_point` array.


<img src="{{site.url}}{{site.baseurl}}/images/kendra_query.png" alt="OpenSearch Intelligent Ranking query"/>{: .img-fluid }

1. Enter `snacking nuts` in the search bar.
1. Enter the following query, which searches the `bullet_point` field for the search text "snacking nuts", in **Query 1**:

```json
{
"query": {
"match": {
"bullet_point": "%SearchText%"
}
},
"size": 25
}
```
1. Enter the same query with intelligent ranking in **Query 2**:

```json
{
"query" : {
"match" : {
"bullet_point": "%SearchText%"
}
},
"size": 25,
"ext": {
"search_configuration":{
"result_transformer" : {
"kendra_intelligent_ranking": {
"order": 1,
"properties": {
"title_field": "item_name",
"body_field": "bullet_point"
}
}
}
}
}
}
```

In the preceding query, `body_field` refers to the body field of the documents in the index, on which Kendra Intelligent Ranking ranks the results. The `body_field` is required, while the `title_field` is optional.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can this read "...the documents in the index, which Kendra Intelligent Ranking uses to rank the results."?

1. Select **Search** and compare the results in **Result 1** and **Result 2**.
Binary file added images/kendra_query.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.