elastic / elasticsearch

Free and Open Source, Distributed, RESTful Search Engine
https://www.elastic.co/products/elasticsearch
Other
69.72k stars 24.67k forks source link

Generate an explain for vector search knn #109018

Open sachin-frayne opened 4 months ago

sachin-frayne commented 4 months ago

Description

Following the vector search demo in /app/enterprise_search/vector_search I wanted to see the equation that is used to generate the score, in a similar way to lexical search with BM25 and the Explain API.

https://www.elastic.co/guide/en/elasticsearch/reference/current/search-explain.html

POST /image-index/_search
{
  "explain": true,
  "query": {
    "knn": {
      "field": "image-vector",
      "query_vector": [
        -5,
        9,
        -12
      ],
      "num_candidates": 100
    }
  }
}
elasticsearchmachine commented 4 months ago

Pinging @elastic/es-search (Team:Search)

elasticsearchmachine commented 2 months ago

Pinging @elastic/es-search-relevance (Team:Search Relevance)