Method: projects.locations.indexEndpoints.searchIndexEndpoint

搜尋已部署的索引端點 (僅限圖片語料庫類型)。

HTTP 要求

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

這個網址使用 gRPC 轉碼語法。

路徑參數

參數
indexEndpoint

string

這是必要旗標,要搜尋的索引端點。Format: `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。全球搜尋查詢的其中一個。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

詳情請參閱 身分與存取權管理說明文件

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

資產的資源名稱。僅支援圖片語料庫類型。格式:projects/{project_number}/locations/{locationId}/corpora/{corpus_id}/assets/{assetId}