Method: projects.locations.indexEndpoints.searchIndexEndpoint

搜索已部署的索引端点(仅限图片语料库类型)。

HTTP 请求

POST https://visionai.googleapis.com/v1/{indexEndpoint=projects/*/locations/*/indexEndpoints/*}:searchIndexEndpoint

网址采用 gRPC 转码语法。

路径参数

参数
indexEndpoint

string

必需。要搜索的索引端点。格式:`projects/{projectId}/locations/{locationId}/indexEndpoints/{indexEndpointId}'

请求正文

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

JSON 表示法
{
  "criteria": [
    {
      object (Criteria)
    }
  ],
  "exclusionCriteria": [
    {
      object (Criteria)
    }
  ],
  "pageSize": integer,
  "pageToken": string,

  // Union field query can be only one of the following:
  "imageQuery": {
    object (ImageQuery)
  },
  "textQuery": string
  // End of list of possible types for union field query.
}
字段
criteria[]

object (Criteria)

应用于搜索结果的条件。

exclusionCriteria[]

object (Criteria)

要从搜索结果中排除的条件。请注意,系统会忽略 fetchMatchedAnnotations

pageSize

integer

请求的页面大小。 API 返回的结果可能少于请求的结果。如果为负数,则会返回 INVALID_ARGUMENT 错误。如果未指定或为 0,API 将选择默认大小(即 10)。如果请求的每页数据大小大于上限,API 将选择上限(即 100)。

pageToken

string

用于提取下一页的接续令牌。如果为空,则表示正在提取第一页。

联合字段 query。oneof 全局搜索查询。query 只能是下列其中一项:
imageQuery

object (ImageQuery)

仅查询图片。

textQuery

string

纯文本查询。

响应正文

针对 indexEndpoints.searchIndexEndpoint 的响应消息。

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

JSON 表示法
{
  "searchResultItems": [
    {
      object (SearchResultItem)
    }
  ],
  "nextPageToken": string
}
字段
searchResultItems[]

object (SearchResultItem)

返回的搜索结果。

nextPageToken

string

下一页的接续令牌。如果省略此字段,则不存在后续页面。

授权范围

需要以下 OAuth 范围:

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

如需了解详情,请参阅身份验证概览

IAM 权限

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

  • visionai.indexEndpoints.search

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

ImageQuery

搜索端点请求的图片查询。

JSON 表示法
{

  // Union field image can be only one of the following:
  "inputImage": string,
  "asset": string
  // End of list of possible types for union field image.
}
字段

联合字段 image

image 只能是下列其中一项:

inputImage

string (bytes format)

以原始字节形式输入图片。

使用 base64 编码的字符串。

asset

string

资产的资源名称。仅在 IMAGE 语料库类型中受支持。格式:projects/{project_number}/locations/{locationId}/corpora/{corpus_id}/assets/{assetId}