Search
The SearchClient class provides methods to perform search requests.
Methods
Make a search request
Description: This method performs a search across a specific index using text, media, or a combination of both as your query and returns a paginated iterator of search results.
Text queries:
- Use the
query_textparameter to specify your query.
Media queries:
- Set the
query_media_typeparameter to the corresponding media type (example:image). - Specify either one of the following parameters:
query_media_url: Publicly accessible URL of your media file.query_media_file: Local media file. If bothquery_media_urlandquery_media_fileare specified in the same request,query_media_urltakes precedence.
Composed text and media queries (Marengo 3.0 only):
- Use the
query_textparameter for your text query. - Set
query_media_typetoimage. - Specify the image using either the
query_media_urlor thequery_media_fileparameter.
Note
When using images in your search queries (either as media queries or in composed searches), ensure your image files meet the format requirements.
Entity search (Marengo 3.0 only):
- To find a specific person in your videos, enclose the unique identifier of the entity you want to find in the
query_textparameter.
For instructions on setting up and using this feature, see the Entity search page.
Function signature and example:
Parameters:
Return value: Returns a SyncPager[SearchItem] object that allows you to iterate through the paginated search results.
The SyncPager[T] class contains the following properties and methods:
The SearchItem class contains the following properties:
The SearchItemClipsItem class contains the following properties:
API Reference: Any-to-video search.
Related guides:
Error codes
This section lists the most common error messages you may encounter while performing search requests.
search_option_not_supported- Search option
{search_option}is not supported for index{index_id}. Please use one of the following search options:{supported_search_option}.
- Search option
search_option_combination_not_supported- Search option
{search_option}is not supported with{other_combination}.
- Search option
search_filter_invalid- Filter used in search is invalid. Please use the valid filter syntax by following filtering documentation.
search_page_token_expired- The token that identifies the page to be retrieved is expired or invalid. You must make a new search request. Token:
{next_page_token}.
- The token that identifies the page to be retrieved is expired or invalid. You must make a new search request. Token:
index_not_supported_for_search:- You can only perform search requests on indexes with an engine from the Marengo family enabled.
For a list of errors specific to this endpoint and general errors that apply to all endpoints, see the Error codes page.