Endpoints
query() when you know the exact index and filter fields.
Request body
Do not pass
index_names or index_ids to query().
Example
Response
Returns aSearchResult containing Shot objects.Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Run structured filters over one queryable index.
POST /video/{video_id}/query
POST /collection/{collection_id}/query
query() when you know the exact index and filter fields.
| Field | Type | Required | Description |
|---|---|---|---|
index_name | string | no | Optional index name to query. |
index_id | string | no | Optional index ID to query. |
filter | list/object | no | Explicit filter spec. A top-level list is an implicit AND. |
limit | integer | no | Maximum returned rows/moments. Defaults to 100. |
sort | list/string/object | no | Sort field and direction. |
return_fields | string/list/dict | no | Select indexes to hydrate under shot.metadata["indexes"]. |
index_names or index_ids to query().
results = collection.query(
index_name="objects",
filter=[
{"field": "label", "op": "contains", "value": "cell phone"},
],
limit=100,
sort=[("max_score", "desc")],
return_fields=["objects"],
)
SearchResult containing Shot objects.