diff --git a/docs/reference/elasticsearch/rest-apis/retrievers.md b/docs/reference/elasticsearch/rest-apis/retrievers.md index 6a5c27a781a4b..429f69cffa7ac 100644 --- a/docs/reference/elasticsearch/rest-apis/retrievers.md +++ b/docs/reference/elasticsearch/rest-apis/retrievers.md @@ -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` @@ -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 { @@ -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.