Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions src/hnsw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,6 @@ pub struct HnswIndex {
unsafe impl Sync for HnswIndex {}
unsafe impl Send for HnswIndex {}

pub const DEFAULT_MAX_ELEMENTS: usize = 10000;

pub struct HnswIndexLoadConfig {
pub distance_function: HnswDistanceFunction,
pub dimensionality: i32,
Expand Down Expand Up @@ -224,7 +222,7 @@ impl HnswIndex {
let path = CString::new(path).map_err(|e| HnswInitError::InvalidPath(e.to_string()))?;

unsafe {
load_index(ffi_ptr, path.as_ptr(), true, true, DEFAULT_MAX_ELEMENTS);
load_index(ffi_ptr, path.as_ptr(), true, true, 0);
}
read_and_return_hnsw_error(ffi_ptr)?;

Expand Down Expand Up @@ -378,7 +376,7 @@ impl HnswIndex {
read_and_return_hnsw_error(ffi_ptr)?;

unsafe {
load_index_from_hnsw_data(ffi_ptr, load_data.ffi_ptr, DEFAULT_MAX_ELEMENTS);
load_index_from_hnsw_data(ffi_ptr, load_data.ffi_ptr, 0);
}
read_and_return_hnsw_error(ffi_ptr)?;

Expand Down
Loading