The SearchWrapper class provides methods to perform search requests.
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:
queryText parameter to specify your query.Media queries:
queryMediaType parameter to the corresponding media type (example: image).queryMediaUrl: Publicly accessible URL of your media file.queryMediaFile: Local media file.
If you specify both, queryMediaUrl takes precedence.queryMediaUrls: Publicly accessible URLs of your media files.queryMediaFiles: Local media files.Composed text and media queries:
queryText parameter for your text query.queryMediaType to image.queryMediaUrl, queryMediaFile, queryMediaUrls, or queryMediaFiles.When using images in your search queries (either as media queries or in composed searches), ensure your image files meet the requirements.
Entity search:
queryText parameter.For instructions on setting up and using this feature, see the Entity search page.
This method is rate-limited. For details, see the Rate limits page.
Function signature and example:
The SearchCreateRequest interface defines the parameters for performing a search:
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:
This section lists the most common error messages you may encounter while performing search requests.
search_option_not_supported
{search_option} is not supported for index {index_id}. Please use one of the following search options: {supported_search_option}.search_option_combination_not_supported
{search_option} is not supported with {other_combination}.search_filter_invalid
search_page_token_expired
{next_page_token}.index_not_supported_for_search:
For a list of general errors that apply to all endpoints, see the Error codes page.