hnswlib icon indicating copy to clipboard operation
hnswlib copied to clipboard

why do we need to declare the maximum number of elements the index can store beforehand?

Open siddhsql opened this issue 1 year ago • 7 comments

from the docs:

# Initializing index - the maximum number of elements should be known beforehand
p.init_index(max_elements = num_elements, ef_construction = 200, M = 16)

why do we need to declare the maximum number of elements the index can store beforehand? i don't see any constraint like this in the algorithm described in the hnswlib paper. thanks.

siddhsql avatar Jul 11 '23 15:07 siddhsql