New projects should use the Documents API. To move an existing index, see Move to the Documents API.
Fetch records by ID
To fetch records from a namespace based on their IDs, use thefetch operation with the following parameters:
namespace: The namespace containing the records to fetch. To use the default namespace, set this to"__default__".ids: The IDs of the records to fetch. Maximum of 1000.
For on-demand indexes, since vector values are retrieved from object storage, fetch operations may have increased latency. If you only need metadata or IDs, consider using the Search with a vector operation instead, with
include_values left at its default of false. See Decrease latency for more details.Fetch records by metadata
To fetch records from a namespace based on their metadata values, use thefetch_by_metadata operation with the following parameters:
For example, the following code fetches 2 records with a
genre field set to Action/Adventure from the default namespace:
pagination object with a next token. When there are no more results, the response doesn’t include a pagination object.
Fetch limits
Fetch by ID limits
Fetch by metadata limits
To retrieve more than 10,000 matching records, paginate through results using the
paginationToken parameter. See Fetch records by metadata.