VectorSearch

定义使用查询向量的搜索操作。

JSON 表示法
{
  "searchField": string,
  "filter": {
    object
  },
  "outputFields": {
    object (OutputFields)
  },
  "searchHint": {
    object (SearchHint)
  },
  "distanceMetric": enum (DistanceMetric),

  // Union field vector_type can be only one of the following:
  "vector": {
    object (DenseVector)
  },
  "sparseVector": {
    object (SparseVector)
  }
  // End of list of possible types for union field vector_type.
  "topK": integer
}
字段
searchField

string

必需。要搜索的向量字段。

filter

object (Struct format)

可选。JSON 过滤条件表达式,例如 {"genre": {"$eq": "sci-fi"}},表示为 google.protobuf.Struct。

outputFields

object (OutputFields)

可选。指定要返回的字段的掩码。

searchHint

object (SearchHint)

可选。设置搜索提示。如果未指定策略,服务将使用索引(如果有),否则将回退到默认的 KNN 搜索。

distanceMetric

enum (DistanceMetric)

可选。用于 KNN 搜索的距离指标。如果未指定,则默认使用 DOT_PRODUCT。

联合字段 vector_type

vector_type 只能是下列其中一项:

vector

object (DenseVector)

查询的密集向量。

sparseVector

object (SparseVector)

查询的稀疏向量。

topK

integer

可选。要返回的最近邻数量。