VectorSearch Stay organized with collections Save and categorize content based on your preferences.
Defines a search operation using a query vector.
| JSON representation |
|---|
{"searchField":string,"filter":{object},"outputFields":{object ( |
| Fields | |
|---|---|
searchField |
Required. The vector field to search. |
filter |
Optional. A JSON filter expression, e.g. {"genre": {"$eq": "sci-fi"}}, represented as a google.protobuf.Struct. |
outputFields |
Optional. Mask specifying which fields to return. |
searchHint |
Optional. Sets the search hint. If no strategy is specified, the service will use an index if one is available, and fall back to the default KNN search otherwise. |
distanceMetric |
Optional. The distance metric to use for the KNN search. If not specified, DOT_PRODUCT will be used as the default. |
Union field
| |
vector |
A dense vector for the query. |
sparseVector |
A sparse vector for the query. |
topK |
Optional. The number of nearest neighbors to return. |
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-01-29 UTC.