Method: projects.locations.collections.dataObjects.batchSearch

批量搜索数据对象。

HTTP 请求

POST https://vectorsearch.googleapis.com/v1beta/{parent}/dataObjects:batchSearch

路径参数

参数
parent

string

必需。要搜索的集合的资源名称。格式:projects/{project}/locations/{location}/collections/{collection}

请求正文

请求正文中包含结构如下的数据:

JSON 表示法
{
  "searches": [
    {
      object (Search)
    }
  ],
  "combine": {
    object (CombineResultsOptions)
  }
}
字段
searches[]

object (Search)

必需。要并行执行的搜索请求的列表。

combine

object (CombineResultsOptions)

可选。用于合并批量搜索操作结果的选项。

响应正文

批量搜索操作的响应。

如果成功,响应正文将包含结构如下的数据:

JSON 表示法
{
  "results": [
    {
      object (SearchDataObjectsResponse)
    }
  ]
}
字段
results[]

object (SearchDataObjectsResponse)

仅限输出。搜索响应列表,其中每个响应对应批处理中的一个请求。如果使用排名器,则返回单个排名后的结果列表。

授权范围

需要以下 OAuth 范围:

  • https://www.googleapis.com/auth/cloud-platform

如需了解详情,请参阅 Authentication Overview

IAM 权限

需要拥有 parent 资源的以下 IAM 权限:

  • vectorsearch.dataObjects.search

如需了解详情,请参阅 IAM 文档

CombineResultsOptions

用于合并批量搜索操作结果的选项。

JSON 表示法
{
  "ranker": {
    object (Ranker)
  },
  "outputFields": {
    object (OutputFields)
  },
  "topK": integer
}
字段
ranker

object (Ranker)

必需。用于合并结果的排名器。

outputFields

object (OutputFields)

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

topK

integer

可选。要返回的结果的数量。 如果未设置,系统将使用默认值。

Ranker

定义用于合并多次搜索结果的排序器。

JSON 表示法
{

  // Union field ranker can be only one of the following:
  "rrf": {
    object (ReciprocalRankFusion)
  },
  "vertex": {
    object (VertexRanker)
  }
  // End of list of possible types for union field ranker.
}
字段
联合字段 ranker。要使用的排名方法。ranker 只能是下列其中一项:
rrf

object (ReciprocalRankFusion)

倒数排序融合排名。

vertex

object (VertexRanker)

Vertex AI 排名。

ReciprocalRankFusion

定义用于结果排名的倒数排序融合 (RRF) 算法。

JSON 表示法
{
  "weights": [
    number
  ]
}
字段
weights[]

number

必需。在融合期间应用于每个搜索结果集的权重。

VertexRanker

使用 Vertex AI 排名服务定义排名器。如需了解详情,请参阅 https://cloud.google.com/generative-ai-app-builder/docs/ranking

JSON 表示法
{
  "query": string,
  "titleTemplate": string,
  "contentTemplate": string,
  "model": string
}
字段
query

string

必需。用于对记录进行排名和评分的查询。

titleTemplate

string

可选。用于生成记录标题的模板。

contentTemplate

string

可选。用于生成记录内容的模板。

model

string

必需。用于对文档进行排名的模型。如果未指定模型,则使用 semantic-ranker-default@latest