const { result, fetchNext, stop } = await index.resumableQuery({
maxIdle: 3600,
topK: 50,
vector: [0, 1, 2, ..., 383], // 384-dimensional vector
includeMetadata: true,
includeVectors: true,
});
console.log(result);
/*
[
{
id: '6345',
score: 1.00000012,
vector: [0, 1, 2, ..., 383],
metadata: {
sentence: "Upstash is great."
}
},
// ... more results
]
*/
const nextBatch = await fetchNext(5); // Fetch next 5 results
console.log(nextBatch);
await stop(); // Stop the resumable query
const { result, fetchNext, stop } = await index.resumableQuery({
maxIdle: 3600,
topK: 50,
vector: [0, 1, 2, ..., 383], // 384-dimensional vector
includeMetadata: true,
includeVectors: true,
});
console.log(result);
/*
[
{
id: '6345',
score: 1.00000012,
vector: [0, 1, 2, ..., 383],
metadata: {
sentence: "Upstash is great."
}
},
// ... more results
]
*/
const nextBatch = await fetchNext(5); // Fetch next 5 results
console.log(nextBatch);
await stop(); // Stop the resumable query
Hide child attributes
vector
or sparseVector
field, depending on your index type. Or you can pass the data
field and create the embeddings using Upstash Embedding.true
would be the best practice, since it will make it easier to
identify the vectors.RRF
.HYBRID
.Hide child attributes
includeVectors
is set to true)includeVectors
is set to true)includeMetadata
is set to true)includeData
is set to true)const { result, fetchNext, stop } = await index.resumableQuery({
maxIdle: 3600,
topK: 50,
vector: [0, 1, 2, ..., 383], // 384-dimensional vector
includeMetadata: true,
includeVectors: true,
});
console.log(result);
/*
[
{
id: '6345',
score: 1.00000012,
vector: [0, 1, 2, ..., 383],
metadata: {
sentence: "Upstash is great."
}
},
// ... more results
]
*/
const nextBatch = await fetchNext(5); // Fetch next 5 results
console.log(nextBatch);
await stop(); // Stop the resumable query
Was this page helpful?