Search
The Resources.Search
class provides methods to perform searches.
Methods
Make a search request
Description: This method performs a search across a specific index based on the provided parameters and returns the first page of results.
Function signature and example:
Parameters:
The SearchOptions
interface defines the parameters for performing a search request:
Return value: Returns a Promise
that resolves to a Models.SearchResult
object containing the search results.
API Reference: For a description of each field in the request and response, see the Any-to-video search page.
Related guides:
- Search.
- Pagination > Search results.
- Sorting > Search results
- Filtering > Search results
- Grouping and ungrouping.
Retrieve a specific page of search results
Description: This method retrieves a specific page of search results.
Note
This method provides direct pagination. Choose it mainly when the total number of items is manageable, or you must fetch a single page of results. When your application must retrieve a large number of items, choose iterative pagination. For details, see the Iterative pagination section.
Function signature and example:
Parameters:
Return value: Returns a Promise
that resolves to a Models.SearchResult
object containing the search results.
API Reference: For a description of each field in the request and response, see the Retrieve a specific page of search results page.
Related guides:
- Search.
- Pagination > Search results.
- Sorting > Search results
- Filtering > Search results
- Grouping and ungrouping.
Iterative pagination
If your application must retrieve a large number of items, use iterative pagination. To retrieve the first page of results, invoke the query
method of the search
object. To retrieve subsequent pages of results, use the async iterator protocol.