Required. The resource name of the Dataset from which to search DataItems. Format: projects/{project}/locations/{location}/datasets/{dataset}
Query parameters
savedQuery (deprecated)
string
The resource name of a SavedQuery(annotation set in UI). Format: projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{savedQuery} All of the search will be done in the context of this SavedQuery.
dataLabelingJob
string
The resource name of a DataLabelingJob. Format: projects/{project}/locations/{location}/dataLabelingJobs/{dataLabelingJob} If this field is set, all of the search will be done in the context of this DataLabelingJob.
dataItemFilter
string
An expression for filtering the DataItem that will be returned.
data_item_id - for = or !=.
labeled - for = or !=.
has_annotation(ANNOTATION_SPEC_ID) - true only for DataItem that have at least one annotation with annotationSpecId = ANNOTATION_SPEC_ID in the context of SavedQuery or DataLabelingJob.
For example:
dataItem=1
has_annotation(5)
annotationsFilter (deprecated)
string
An expression for filtering the Annotations that will be returned per DataItem. * annotationSpecId - for = or !=.
annotationFilters[]
string
An expression that specifies what Annotations will be returned per DataItem. Annotations satisfied either of the conditions will be returned. * annotationSpecId - for = or !=. Must specify savedQueryId= - saved query id that annotations should belong to.
Expression that allows ranking results based on annotation's property.
Fields
savedQuery
string
Required. Saved query of the Annotation. Only Annotations belong to this saved query will be considered for ordering.
orderBy
string
A comma-separated list of annotation fields to order by, sorted in ascending order. Use "desc" after a field name for descending. Must also specify savedQuery.
JSON representation
{"savedQuery": string,"orderBy": string}
DataItemView
A container for a single DataItem and Annotations on it.
The Annotations on the DataItem. If too many Annotations should be returned for the DataItem, this field will be truncated per annotationsLimit in request. If it was, then the hasTruncatedAnnotations will be set to true.
hasTruncatedAnnotations
boolean
True if and only if the Annotations field has been truncated. It happens if more Annotations for this DataItem met the request's annotationFilter than are allowed to be returned by annotationsLimit. Note that if Annotations field is not being returned due to field mask, then this field will not be set to true no matter how many Annotations are there.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-06-27 UTC."],[],[],null,["# Method: datasets.searchDataItems\n\n**Full name**: projects.locations.datasets.searchDataItems\n\nSearches DataItems in a Dataset. \n\n### Endpoint\n\nget `https:``/``/{service-endpoint}``/v1beta1``/{dataset}:searchDataItems` \nWhere `{service-endpoint}` is one of the [supported service endpoints](/vertex-ai/docs/reference/rest#rest_endpoints).\n\n### Path parameters\n\n`dataset` `string` \nRequired. The resource name of the Dataset from which to search DataItems. Format: `projects/{project}/locations/{location}/datasets/{dataset}`\n\n### Query parameters\n\n`savedQuery` \n**(deprecated)** `string` \nThe resource name of a SavedQuery(annotation set in UI). Format: `projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{savedQuery}` All of the search will be done in the context of this SavedQuery.\n`dataLabelingJob` `string` \nThe resource name of a DataLabelingJob. Format: `projects/{project}/locations/{location}/dataLabelingJobs/{dataLabelingJob}` If this field is set, all of the search will be done in the context of this DataLabelingJob.\n`dataItemFilter` `string` \nAn expression for filtering the DataItem that will be returned.\n\n- `data_item_id` - for = or !=.\n- `labeled` - for = or !=.\n- `has_annotation(ANNOTATION_SPEC_ID)` - true only for DataItem that have at least one annotation with annotationSpecId = `ANNOTATION_SPEC_ID` in the context of SavedQuery or DataLabelingJob.\n\nFor example:\n\n- `dataItem=1`\n- `has_annotation(5)`\n`annotationsFilter` \n**(deprecated)** `string` \nAn expression for filtering the Annotations that will be returned per DataItem. \\* `annotationSpecId` - for = or !=.\n`annotationFilters[]` `string` \nAn expression that specifies what Annotations will be returned per DataItem. Annotations satisfied either of the conditions will be returned. \\* `annotationSpecId` - for = or !=. Must specify `savedQueryId=` - saved query id that annotations should belong to.\n`fieldMask` `string (`[FieldMask](https://protobuf.dev/reference/protobuf/google.protobuf/#field-mask)` format)` \nMask specifying which fields of [DataItemView](/vertex-ai/docs/reference/rest/v1beta1/projects.locations.datasets/searchDataItems#DataItemView) to read.\n\nThis is a comma-separated list of fully qualified names of fields. Example: `\"user.displayName,photo\"`.\n`annotationsLimit` `integer` \nIf set, only up to this many of Annotations will be returned per DataItemView. The maximum value is 1000. If not set, the maximum value will be used.\n`pageSize` `integer` \nRequested page size. Server may return fewer results than requested. Default and maximum page size is 100.\n`orderBy` \n**(deprecated)** `string` \nA comma-separated list of fields to order by, sorted in ascending order. Use \"desc\" after a field name for descending.\n`pageToken` `string` \nA token identifying a page of results for the server to return Typically obtained via [SearchDataItemsResponse.next_page_token](/vertex-ai/docs/reference/rest/v1beta1/projects.locations.datasets/searchDataItems#body.SearchDataItemsResponse.FIELDS.next_page_token) of the previous [DatasetService.SearchDataItems](/vertex-ai/docs/reference/rest/v1beta1/projects.locations.datasets/searchDataItems#google.cloud.aiplatform.v1beta1.DatasetService.SearchDataItems) call. \n`order` `Union type` \n`order` can be only one of the following:\n`orderByDataItem` `string` \nA comma-separated list of data item fields to order by, sorted in ascending order. Use \"desc\" after a field name for descending.\n`orderByAnnotation` `object (`[OrderByAnnotation](/vertex-ai/docs/reference/rest/v1beta1/projects.locations.datasets/searchDataItems#OrderByAnnotation)`)` \nExpression that allows ranking results based on annotation's property.\n\n### Request body\n\nThe request body must be empty. \n\n### Response body\n\nResponse message for [DatasetService.SearchDataItems](/vertex-ai/docs/reference/rest/v1beta1/projects.locations.datasets/searchDataItems#google.cloud.aiplatform.v1beta1.DatasetService.SearchDataItems).\n\nIf successful, the response body contains data with the following structure:\nFields `dataItemViews[]` `object (`[DataItemView](/vertex-ai/docs/reference/rest/v1beta1/projects.locations.datasets/searchDataItems#DataItemView)`)` \nThe DataItemViews read.\n`nextPageToken` `string` \nA token to retrieve next page of results. Pass to [SearchDataItemsRequest.page_token](/vertex-ai/docs/reference/rest/v1beta1/projects.locations.datasets/searchDataItems#body.QUERY_PARAMETERS.page_token) to obtain that page. \n\nOrderByAnnotation\n-----------------\n\nExpression that allows ranking results based on annotation's property.\nFields `savedQuery` `string` \nRequired. Saved query of the Annotation. Only Annotations belong to this saved query will be considered for ordering.\n`orderBy` `string` \nA comma-separated list of annotation fields to order by, sorted in ascending order. Use \"desc\" after a field name for descending. Must also specify savedQuery. \n\nDataItemView\n------------\n\nA container for a single DataItem and Annotations on it.\nFields `dataItem` `object (`[DataItem](/vertex-ai/docs/reference/rest/v1beta1/DataItem)`)` \nThe DataItem.\n`annotations[]` `object (`[Annotation](/vertex-ai/docs/reference/rest/v1beta1/Annotation)`)` \nThe Annotations on the DataItem. If too many Annotations should be returned for the DataItem, this field will be truncated per annotationsLimit in request. If it was, then the hasTruncatedAnnotations will be set to true.\n`hasTruncatedAnnotations` `boolean` \nTrue if and only if the Annotations field has been truncated. It happens if more Annotations for this DataItem met the request's annotationFilter than are allowed to be returned by annotationsLimit. Note that if Annotations field is not being returned due to field mask, then this field will not be set to true no matter how many Annotations are there."]]