Search
The SearchWrapper 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
queryTtextparameter to specify your query.
Media queries:
- Set the
queryMediaTypeparameter to the corresponding media type (example:image). - Specify either one of the following parameters:
queryMediaUrl: Publicly accessible URL of your media file.queryMediaFile: Local media file. If bothqueryMediaUrlandqueryMediaFileare specified in the same request,queryMediaUrltakes precedence.
Composed text and media queries (Marengo 3.0 only):
- Use the
queryTextparameter for your text query. - Set
queryMediaTypetoimage. - Specify the image using either the
queryMediaUrlor thequeryMediaFileparameter.
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:
The SearchCreateRequest interface defines the parameters for performing a search:
Return value: Returns a Promise that resolves to a Page<SearchItem> object that implements AsyncIterable, allowing you to iterate through the paginated search results.
The Page class contains the following properties and methods:
The SearchItem interface contains the following properties:
The SearchItemClipsItem interface 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.