docs/documentation/indexing/indexing-vectors.mdx
The ParadeDB index can index pgvector's vector type alongside your text and other columns. This lets you combine vector search with full text search and filters in a single index,
which can significantly improve latency/recall for selective queries.
The mock_items table comes with an embedding column of type vector(8) populated with sample embeddings.
In this example, embedding is added to the ParadeDB index with cosine similarity as the distance function.
// Vector search support for Drizzle is coming very soon.
# Vector search support for Django is coming very soon.
# Vector search support for SQLAlchemy is coming very soon.
# Vector search support for Rails is coming very soon.
// Vector search support for EF Core is coming very soon.
The desired distance function is encoded into the index definition, and cannot be changed without reindexing.
Use vector_l2_ops for L2 distance, vector_ip_ops for inner product, or vector_cosine_ops for cosine distance.
ParadeDB uses a SPANN-style vector index, which is similar to an IVF index but with additional structures to improve
recall and latency, especially over large datasets. The following WITH options control how vectors are clustered and indexed. All are set at index build time and apply to every vector field in the index. An example:
// Vector search support for Drizzle is coming very soon.
# Vector search support for Django is coming very soon.
# Vector search support for SQLAlchemy is coming very soon.
# Vector search support for Rails is coming very soon.
// Vector search support for EF Core is coming very soon.