Upstash Documentation

Start with Vector

Perform queries that can be resumed to fetch additional results.
2 min read
posthttps://{endpoint}/resumable-query/{namespace}
posthttps://{endpoint}/resumable-query/{namespace}
Tip

Resumable queries allow you to fetch results in batches, which is useful for large result sets or when you want to implement pagination.

Request#

vectornumber[]required#
The query vector
Note
The query vector should have the same dimensions as your index.
topKnumber#

The total number of the vectors that you want to receive as a query result. The response will be sorted based on the distance metric score, and at most topK many vectors will be returned.

Default: "10"

includeMetadataboolean#

Whether to include the metadata of the vectors in the response, if any. It is recommended to set this to true to easily identify vectors.

Default: "false"

includeVectorsboolean#

Whether to include the vector values in the response. It is recommended to set this to false as the vector values can be quite big, and not needed most of the time.

Default: "false"

includeDataboolean#

Whether to include the data of the vectors in the response, if any.

Default: "false"

filterstring#

Metadata filter to apply.

Default: ""

maxIdlenumber#

Maximum idle time for the resumable query in seconds.

weightingStrategystring#

For sparse vectors of sparse and hybrid indexes, specifies what kind of weighting strategy should be used while querying the matching non-zero dimension values of the query vector with the documents.

If not provided, no weighting will be used.

Only possible value is IDF (inverse document frequency).

fusionAlgorithmstring#

Fusion algorithm to use while fusing scores from dense and sparse components of a hybrid index.

If not provided, defaults to RRF (Reciprocal Rank Fusion).

Other possible value is DBSF (Distribution-Based Score Fusion).

Path#

namespacestring#

The namespace to use. When no namespace is specified, the default namespace will be used.

Default: ""

Response#

uuidstringrequired#

A unique identifier for the resumable query.

scoresObject[]#
Show properties
idstringrequired#

The id of the vector.

scorenumberrequired#

The similarity score of the vector, calculated based on the distance metric of your index.

vectornumber[]#

The dense vector value for dense and hybrid indexes.

sparseVectorObject[]#

The sparse vector value for sparse and hybrid indexes.

Show properties
indicesnumber[]#

Indices of the non-zero valued dimensions.

valuesnumber[]#

Values of the non-zero valued dimensions.

metadataObject#

The metadata of the vector, if any.

datastring#

The unstructured data of the vector, if any.