com.phronemophobic.usearch

add

(add index key vec)(add index key vec vector-kind)

Adds a vector with a key to the index.

index: A usearch index. key: An integer key vec: A vector to add to the index.

capacity

(capacity index)

The currently reserved capacity of index.

init

(init opts vecs)(init opts)

Creates a new index with opts.

If vecs are provided, they will be added to index. vecs should be a sequence of key, vec pairs.

Required:

:dimensions Length of vectors that will be indexed :metric The metric used to measure distance. One of :metric/cos :metric/divergence :metric/hamming :metric/haversine :metric/ip :metric/jaccard :metric/l2sq :metric/pearson :metric/sorensen :metric/tanimoto :quantization The datatype for the vectors that will be indexed. One of :quantization/f32 :quantization/f64 :quantization/i8

Optional:

:connectivity limits connections-per-node in graph :expansions-add expansion factor used for index construction when adding vectors. :expansions-search used for index construction during search operations.

IVectorKind

protocol

members

vector-kind

(vector-kind this)

load

(load index path)

Loads the index from path. index must have already been initialized.

remove

(remove index key)

Removes the vector associated with the given key from the index.

rename

(rename index from to)

Renames the vector to map to a different key.

reserve

(reserve index capacity)

Sets capacity to capacity.

Has no effect if capacity is lower than the index's current capacity.

save

(save index path)

Saves index to a file at path.

serialized-length

(serialized-length index)

Reports expected file size after serialization.

size

(size index)

Number of indexed vectors.