Method: projects.locations.indexEndpoints.searchIndexEndpoint

Search a deployed index endpoint (IMAGE corpus type only).

HTTP request

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

The URL uses gRPC Transcoding syntax.

Path parameters

Parameters
indexEndpoint

string

Required. The index endpoint to search. Format: `projects/{projectId}/locations/{locationId}/indexEndpoints/{indexEndpointId}'

Request body

The request body contains data with the following structure:

JSON representation
{
  "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.
}
Fields
criteria[]

object (Criteria)

Criteria applied to search results.

exclusionCriteria[]

object (Criteria)

Criteria to exclude from search results. Note that fetchMatchedAnnotations will be ignored.

pageSize

integer

Requested page size. API may return fewer results than requested. If negative, INVALID_ARGUMENT error will be returned. If unspecified or 0, API will pick a default size, which is 10. If the requested page size is larger than the maximum size, API will pick the maximum size, which is 100.

pageToken

string

The continuation token to fetch the next page. If empty, it means it is fetching the first page.

Union field query. The oneof global search query. query can be only one of the following:
imageQuery

object (ImageQuery)

An image-only query.

textQuery

string

A text-only query.

Response body

Response message for indexEndpoints.searchIndexEndpoint.

If successful, the response body contains data with the following structure:

JSON representation
{
  "searchResultItems": [
    {
      object (SearchResultItem)
    }
  ],
  "nextPageToken": string
}
Fields
searchResultItems[]

object (SearchResultItem)

Returned search results.

nextPageToken

string

The next-page continuation token. If this field is omitted, there are no subsequent pages.

Authorization scopes

Requires the following OAuth scope:

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

For more information, see the Authentication Overview.

IAM Permissions

Requires the following IAM permission on the indexEndpoint resource:

  • visionai.indexEndpoints.search

For more information, see the IAM documentation.

ImageQuery

Image query for search endpoint request.

JSON representation
{

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

Union field image.

image can be only one of the following:

inputImage

string (bytes format)

Input image in raw bytes.

A base64-encoded string.

asset

string

Resource name of the asset. Only supported in IMAGE corpus type. Format: projects/{project_number}/locations/{locationId}/corpora/{corpus_id}/assets/{assetId}