to_dict and from_dict convert a query to and from a JSON-compatible dict, so it can be kept in config.
Methods that act on the files a query matches, such as link_query_items(), run as
jobs and report on them with QueryItemsJob.
FolderScope Objects
FileNameCondition Objects
F.file_name.
DataTypeCondition Objects
F.data_type.
MimeTypeCondition Objects
F.mime_type.
UploadedAtCondition Objects
F.uploaded_at.
MetadataCondition Objects
F.metadata.
MetricCondition Objects
F.metric.
FrameMetadataCondition Objects
F.frame.metadata.
FrameMetricCondition Objects
F.frame.metric.
SimilarToFilesRank Objects
SimilarToTextRank Objects
CurationQuery Objects
scope that meet every condition in filters.
A query can have at most 64 filters. With no filters, it matches every file.
With rank_by, which needs premium access to Index, the query matches only its top_k most similar files, and
leaves out files without embeddings. query_storage_items() returns them
most similar first.
Scope Objects
folder
folder- The folder, or its UUID.
FolderScope- The scope for that folder.
RankBy Objects
similar_to_files
files, 1 to 100 files you can see, and leaves those files out. The query
matches the top_k most similar files, 1 to 1,000.
Files without embeddings are ignored, so if none of files has one, the query matches no files.
similar_to_text
top_k most similar files, 1 to 1,000.
Searching, counting or linking raises InvalidArgumentsError for longer text.
_FileNameField Objects
eq
is_in
names.
not_in
names.
contains_text
text, ignoring case.
not_contains_text
text, ignoring case.
_DataTypeField Objects
eq
is_in
not_in
_MimeTypeField Objects
eq
image/jpeg.
is_in
not_in
_UploadedAtField Objects
gte
time, which must have a timezone.
lte
time, which must have a timezone.
_MetadataField Objects
eq
value.
is_in
values.
not_in
values.
contains_text
text, ignoring case.
not_contains_text
text, ignoring case.
gte
bound or more: a number, or a datetime with a timezone.
lte
bound or less: a number, or a datetime with a timezone.
_MetricField Objects
gte
bound or more.
lte
bound or less.
_FrameMetadataField Objects
eq
value.
is_in
values.
contains_text
text, ignoring case.
gte
bound or more: a number, or a datetime with a timezone.
lte
bound or less: a number, or a datetime with a timezone.
_FrameMetricField Objects
gte
bound or more.
lte
bound or less.
_FrameFields Objects
metadata
metric
F Objects
F.file_name:eq,is_inandnot_inmatch the whole name.contains_textandnot_contains_textmatch part of it, ignoring case.F.data_type:eq,is_inandnot_in, with any StorageItemType exceptDICOM_FILE.F.mime_type:eq,is_inandnot_in, with values such asimage/jpeg.F.uploaded_at:gteandlte, each including its bound. Times must have a timezone.F.metadata(key): a key in your organization’s metadata schema, which needs premium access to Index. The key’s type decides its operators: text takeseq,is_in,not_in,contains_textandnot_contains_text; enum and uuid takeeq,is_inandnot_in; number takeseq,gteandlte; datetime takesgteandlte; boolean takeseq. It matches only files that have the key. To filter on a key outside the schema, add it with add_scalar() first.F.metric(name): the file’s size,fileSize, in bytes, withgteandlte. It needs premium access to Index.F.frame.metadata(key): likeF.metadata(key), on a frame, withoutnot_inandnot_contains_text.F.frame.metric(name): a metric of a frame, withgteandlte.width,heightandareaare in pixels, and they andaspectRatioare always available.brightness,contrast,sharpness,red,greenandbluerun from 0 to 1 and need the scope’s top-level folder to be upgraded in Index to compute quality metrics.uniquenessanddiversityrun from 0 to 1 and need it to compute advanced quality metrics.
F.frame conditions when one of its frames meets all of them, and they need premium access to
Index. An image’s only frame is the image itself, and files without frames, such as audio files, never match them.
Lists must contain between 1 and 1,000 values. Conditions on one field combine, so gte and lte together give
a range.
metadata
metric
QueryItemsJobState Objects
- PENDING: The job hasn’t ended yet. Its
processedandtotalsay how far it has got. - SUCCEEDED: The job finished, and processed every file.
- FAILED: The job failed. Files it had already processed stay processed; its
errorsays why. - CANCELLED: The job was cancelled before it finished. Files it had already processed stay processed.
- UNKNOWN: A state this SDK version does not recognize. Upgrade the SDK to see it.
_missing_
QueryItemsJobFailure Objects
reason
Why, as a code such aslink_failed.
QueryItemsJobError Objects
code
A code such aslink_failed.
QueryItemsJob Objects
finished_at
When the job ended, or None until its state is final.processed
Files the job has processed so far, whether or not it succeeded with them.total
Files the job will process, or None until it has worked that out.applied
Files the job processed successfully.skipped
Files the job left as they were, or None for jobs that don’t report them, such as dataset links.failed
Files the job couldn’t process.failures
The first 100 files the job couldn’t process.error
Why the job failed, once its state isFAILED.
