Skip to main content

Vector indices

A vector stores an embedding. It has to be defined with its shape, so that the search index is created for it before the first value is written. Vectors are stored in MongoDB (or Neo4j, see placement) and copied to Elasticsearch, and only get a vector index in Elasticsearch if they ask for one with "index": "vector", see indices. Without an index the vector is only stored.

The settings of the vector (dimensions, elementType and similarity) are described once, on the page of the vector type. Searching by vector similarity is not part of the API yet, the definition makes sure that the data is stored in the right shape in the meantime.

{
"mode": "partial",
"properties": {
"embedding": {
"type": "vector",
"dimensions": 384,
"similarity": "cosine",
"index": "vector"
}
}
}