Resumable Query

Start with Vector

Perform queries that can be resumed to fetch additional results.

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

Request

vectorbodynumber[]required

The query vector

The query vector should have the same dimensions as your index.

topKbodynumberdefault: 10

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.

includeMetadatabodybooleandefault: false

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.

includeVectorsbodybooleandefault: false

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.

includeDatabodybooleandefault: false

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

filterbodystringdefault:

Metadata filter to apply.

maxIdlebodynumber

Maximum idle time for the resumable query in seconds.

weightingStrategybodystring

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).

fusionAlgorithmbodystring

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

namespacepathstringdefault:

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

Response

uuidstringrequired

A unique identifier for the resumable query.

scoresObject[]
curl
curl $UPSTASH_VECTOR_REST_URL/resumable-query \  -X POST \  -H "Authorization: Bearer $UPSTASH_VECTOR_REST_TOKEN" \  -d '{    "vector": [0.1, 0.2],    "topK": 2,    "includeMetadata": true,    "maxIdle": 3600  }'
curl (Namespace)
curl $UPSTASH_VECTOR_REST_URL/resumable-query/ns \  -X POST \  -H "Authorization: Bearer $UPSTASH_VECTOR_REST_TOKEN" \  -d '{    "vector": [0.1, 0.2],    "topK": 2,    "includeMetadata": true,    "maxIdle": 3600  }'
200 OK
{  "uuid": "550e8400-e29b-41d4-a716-446655440000",  "scores": [    {      "id": "id-0",      "score": 1.0,      "metadata": {        "link": "upstash.com"      }    },    {      "id": "id-1",      "score": 0.99996454    }  ]}
Loading search…