Skip to content

Commit f353f86

Browse files
authored
Creates the Kendra plugin section in Compare Search Results (opensearch-project#2060)
* Creates the Kendra plugin section in Compare Search Results Signed-off-by: Fanit Kolchina <[email protected]> * Implemented editorial comments Signed-off-by: Fanit Kolchina <[email protected]> Signed-off-by: Fanit Kolchina <[email protected]>
1 parent f9a9ea1 commit f353f86

File tree

2 files changed

+57
-1
lines changed

2 files changed

+57
-1
lines changed

_search-plugins/search-relevance/index.md

Lines changed: 57 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,4 +98,60 @@ Setting `size` to a high value (for example, larger than 250 documents) may degr
9898
{: .note}
9999

100100
You cannot save a given comparison for future use, so Compare Search Results is not suitable for systematic testing.
101-
{: .note}
101+
{: .note}
102+
103+
## Comparing OpenSearch search results with re-ranked results
104+
105+
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 for OpenSearch**, 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.
106+
107+
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).
108+
109+
Once you've set up Kendra Intelligent Ranking, enter a query in **Query 1** and enter the same query using Kendra Intelligent Ranking in **Query 2**. Then compare the search results from OpenSearch and Amazon Kendra.
110+
111+
### Example
112+
113+
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.
114+
115+
<img src="{{site.url}}{{site.baseurl}}/images/kendra_query.png" alt="OpenSearch Intelligent Ranking query"/>{: .img-fluid }
116+
117+
1. Enter `snacking nuts` in the search bar.
118+
1. Enter the following query, which searches the `bullet_point` field for the search text "snacking nuts", in **Query 1**:
119+
120+
```json
121+
{
122+
"query": {
123+
"match": {
124+
"bullet_point": "%SearchText%"
125+
}
126+
},
127+
"size": 25
128+
}
129+
```
130+
1. Enter the same query with intelligent ranking in **Query 2**:
131+
132+
```json
133+
{
134+
"query" : {
135+
"match" : {
136+
"bullet_point": "%SearchText%"
137+
}
138+
},
139+
"size": 25,
140+
"ext": {
141+
"search_configuration":{
142+
"result_transformer" : {
143+
"kendra_intelligent_ranking": {
144+
"order": 1,
145+
"properties": {
146+
"title_field": "item_name",
147+
"body_field": "bullet_point"
148+
}
149+
}
150+
}
151+
}
152+
}
153+
}
154+
```
155+
156+
In the preceding query, `body_field` refers to the body field of the documents in the index, which Kendra Intelligent Ranking uses to rank the results. The `body_field` is required, while the `title_field` is optional.
157+
1. Select **Search** and compare the results in **Result 1** and **Result 2**.

images/kendra_query.png

55.6 KB
Loading

0 commit comments

Comments
 (0)