Pass metric type to vector search function

Created on 7 November 2024, about 1 month ago

Problem/Motivation

Postgres (pgvector) uses the metric at search time (AiVdbProvider::vectorSearch()) rather than when the collection is created.

Proposed resolution

Pass the configured metric type to the vectorSearch() function as well as createCollection(). This will support both variants.

API changes

Change to SearchApiAiBackend::doSearch() to include the metric type in active config to the vdb provider vectorSearch() method.

Update AiVdbProviderInterface::vectorSearch() to accept VdbSimilarityMetrics $metric_type as a param. This will require that implementing providers update their vectorSearch method signatures.

Feature request
Status

Active

Version

1.0

Component

AI Search

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024