PhoenixVectorDB class

A synchronous handle to an open vector index.

Implemented types

Properties

dimensions → int
Dimensionality of every vector in this index.
no setter
hashCode → int
The hash code for this object.
no setterinherited
isClosed → bool
Whether close has already run.
no setter
kernel → String
Name of the SIMD kernel this CPU selected: avx2+fma, neon or portable.
no setter
maxDimensions → int
Largest dimensionality the native layer accepts.
no setter
maxIdLength → int
Largest vector id, in bytes of UTF-8.
no setter
maxK → int
Largest k a single search may request.
no setter
metric → VectorMetric
Metric this index orders by.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

close() → void
Saves and closes the index.
compact() → int
Rewrites the index without tombstoned records, returning how many were reclaimed.
contains(String id) → bool
True when id is stored and has not been removed.
count() → int
Number of live vectors.
flush() → void
Syncs the vector file without writing a snapshot.
get(String id) → Float32List?
Fetches the vector stored under id, or null when it is absent.
insert(String id, Float32List vector) → void
Inserts or replaces id with vector.
insertAll(Map<String, Float32List> vectors) → void
Inserts every entry of vectors, keyed by id.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
remove(String id) → bool
Removes id, returning false when it was not present.
save({String? path}) → void
Syncs the vector file and writes the HNSW graph snapshot.
Returns the VectorQuery.k nearest neighbours of query, nearest first.
searchVector(Float32List vector, {int k = 10, int? ef}) → List<VectorMatch>
Convenience wrapper: searches for the k nearest neighbours of vector.
stats() → VectorStats
Live, total and deleted record counts.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

open(String path, {required int dimensions, VectorMetric metric = VectorMetric.cosine, int maxElements = 0, String? libraryPath}) → PhoenixVectorDB
Opens (or creates) the vector index at path.