Class to interface with Vector Search indexes (v1) and collections (v2).
VectorSearchSearcher(
self,
endpoint: MatchingEngineIndexEndpoint | None,
index: MatchingEngineIndex | None = None,
staging_bucket: storage.Bucket | None = None,
stream_update: bool = False,
*,
collection: SimpleNamespace | None = None,
api_version: str = 'v1',
project_id: str | None = None,
region: str | None = None,
credentials: Any = None,
vector_field_name: str = 'embedding'
)| Name | Type | Description |
|---|---|---|
endpoint* | MatchingEngineIndexEndpoint | None | The index endpoint (v1 only, None for v2). |
index | MatchingEngineIndex | None | Default: NoneThe index object (v1 only, None for v2). |
collection | SimpleNamespace | None | Default: NoneThe collection object (v2 only, None for v1). |
staging_bucket | storage.Bucket | None | Default: NoneGCS bucket for staging data (v1 only). |
stream_update | bool | Default: FalseWhether to use streaming updates. (v1 only). |
api_version | str | Default: 'v1'Version of the Vector Search API ("v1" or "v2"). |
project_id | str | None | Default: NoneGCP project ID (v2 only). |
region | str | None | Default: NoneGCP region (v2 only). |
credentials | Any | Default: NoneGCP credentials (v2 only). |
vector_field_name | str | Default: 'embedding'Name of the vector field in the schema (v2 only). |
Adds documents to the index.
Finds the k closes neighbors of each instance of embeddings.
Gets datapoint IDs that match the given metadata filter.
Performs semantic search using auto-generated embeddings.
Performs keyword/full-text search on data fields.
Note: Text search does not support filters. Use semantic_search or vector_search if you need filtering.
Performs hybrid search combining semantic and text search with RRF.
Hybrid search runs both semantic search (with auto-generated embeddings) and text search (keyword matching) in parallel, then combines results using Reciprocal Rank Fusion (RRF) algorithm for optimal ranking.