Skip to main content

Multiple vectors

Collections can have multiple named vectors.

The vectors in a collection can have their own configurations. Each vector space can set its own index, its own compression algorithm, and its own vectorizer. This means you can use different vectorization models, and apply different distance metrics, to the same object.

To work with named vectors, adjust your queries to specify a target vector for vector search or hybrid search queries.

Syntax

Single vector collections are valid and continue to use the original collection syntax. However, if you configure multiple vectors, you must use the new, named vector syntax to query your collections.

Collection definition

Use the collection definition to configure the vector spaces for each data object.

Named vectors must be defined at collection creation

All named vectors must be defined when you create a collection. Currently, it is not possible to add or remove named vectors from a collection after it has been created.

Query a named vector

To do a vector search on a collection with named vectors, specify the vector space to search.

Use named vectors with vector similarity searches (near_text, near_object, near_vector, near_image) and hybrid search.

Named vector collections support hybrid search, but only for one vector at a time.

Keyword search syntax does not change if a collection has named vectors.

Query multiple named vectors

Added in v1.26

Where multiple named vectors are defined in a collection, you can query them in a single search. This is useful for comparing the similarity of an object to multiple named vectors.

This is called a "multi-target vector search".

In a multi-target vector search, you can specify:

  • The target vectors to search
  • The query(ies) to compare to the target vectors
  • The weights to apply to each distance (raw, or normalized) for each target vector

Read more in How-to: Multi-target vector search.

Questions and feedback

If you have any questions or feedback, let us know in the user forum.