Skip to content

[POC] Support text similarity reranking based on best-scoring snippet #128255

Closed
kderusso wants to merge 10 commits intoelastic:mainfrom
kderusso:kderusso/rerank-snippet-poc
Closed

[POC] Support text similarity reranking based on best-scoring snippet #128255
kderusso wants to merge 10 commits intoelastic:mainfrom
kderusso:kderusso/rerank-snippet-poc

Conversation

@kderusso
Copy link
Member

@kderusso kderusso commented May 21, 2025

Example:

POST my-index/_search?error_trace
{
  "track_total_hits": true,
  "fields": [
    "text"
  ],
  "retriever": {
    "text_similarity_reranker": {
      "retriever": {
        "standard": {
          "query": {
            "match": {
              "text": "What is the capital of the USA?"
            }
          }
        }
      },
      "field": "text",
      "snippets": {
        "num_fragments": 3,
        "max_size": 20
      },
      "rank_window_size": 10,
      "inference_id": "my-rerank-model",
      "inference_text": "What is the capital of the USA?"
    }
  }
}
@kderusso kderusso changed the title Kderusso/rerank snippet poc May 22, 2025
@kderusso
Copy link
Member Author

kderusso commented Jun 2, 2025

Closing this POC PR. It was useful for discussion, but the final solution will not involve modifying the retriever API to specify snippet information in this manner

@kderusso kderusso closed this Jun 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2 participants