Flutter: listVectors

Lists vectors in the scoped index with pagination. A full-index scan can be distributed across multiple workers by giving each worker a different segmentIndex (0 to segmentCount - 1) for the same segmentCount (1 to 16).

Examples

List vectors

final index = supabase.storage.vectors
    .from('embeddings')
    .index('documents');

final VectorList result = await index.listVectors(
  maxResults: 100,
  returnMetadata: true,
);

for (final vector in result.vectors) {
  print(vector.key);
}

Parallel scan with segments

final index = supabase.storage.vectors
    .from('embeddings')
    .index('documents');

// Worker 2 of a 4-way parallel scan.
final result = await index.listVectors(
  segmentCount: 4,
  segmentIndex: 2,
);