Operators
The platform allows you to build combined queries using the following operators:
and
: A dictionary where the key is the$and
string, and the value is an array of objects. Each object is a subquery. The platform returns the video clips for which all the specified queries match.or
: A dictionary where the key is the$or
string, and the value is an array of objects. Each object is a subquery. The platform returns the video clips for which at least one of the queries matches.not
: A dictionary where the key is the$not
string and the value is a dictionary composed of two queries namedorigin
andsub
. The platform returns the video clips that match theorigin
query but do not match thesub
query. Note that theorigin
andsub
queries can include any number of subqueries.then
: A dictionary where the key is the$then
string, and the value is an array of objects. Each object is a subquery. The platform will return only the results for which the order of the matching video clips is the same as the order of your queries.
The following is an example of a combined query that finds the moments in your videos where a blue or a red car appears:
The following output was truncated for brevity:
The following is an example of a combined query that finds the moments in your video where:
- Someone is cooking
- Italian food is mentioned in the conversation
- Neither the word spaghetti is displayed on the screen nor lasagna is mentioned in the conversation.
The following output was truncated for brevity:
In the example code above, note that the value of the search_options
parameter is set to ["visual"]
for the entire query, and it is overridden on a per-subquery basis.