Skip to content
Closed
Changes from all commits
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
11 changes: 6 additions & 5 deletions docs/reference/elasticsearch/rest-apis/retrievers.md
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,7 @@ score = ln(score), if score < 0
`min_score`
: (Optional, `float`)

Sets a minimum threshold score for including documents in the re-ranked results. Documents with similarity scores below this threshold will be excluded. Note that score calculations vary depending on the model used.
Sets a minimum threshold score for including documents in the re-ranked results. Documents with similarity scores below this threshold will be excluded. Note that score calculations vary depending on the model used and can result in negative values.


`filter`
Expand Down Expand Up @@ -670,6 +670,10 @@ Follow these steps:

2. Define a `text_similarity_rerank` retriever:

::::{note}
The relevance scores produced during reranking depend on the text similarity model used and can include negative values.
::::

```console
POST _search
{
Expand All @@ -687,15 +691,12 @@ Follow these steps:
"field": "text",
"inference_id": "my-elastic-rerank",
"inference_text": "How often does the moon hide the sun?",
"rank_window_size": 100,
"min_score": 0.5
"rank_window_size": 100
}
}
}
```



### Example: Cohere Rerank [text-similarity-reranker-retriever-example-cohere]

This example enables out-of-the-box semantic search by re-ranking top documents using the Cohere Rerank API. This approach eliminates the need to generate and store embeddings for all indexed documents. This requires a [Cohere Rerank inference endpoint](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put) that is set up for the `rerank` task type.
Expand Down
Loading