Skip to content

Commit

Permalink
feat: enable toggling index integrity check on index creation and upd…
Browse files Browse the repository at this point in the history
…ate vec-447
  • Loading branch information
dwelch-spike committed Dec 6, 2024
1 parent 6a4ebd2 commit f6edd33
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/aerospike_vector_search/shared/conversions.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ def fromIndexDefintion(input_data: types_pb2.IndexDefinition) -> types.IndexDefi
m=input_data.hnswParams.m,
ef_construction=input_data.hnswParams.efConstruction,
ef=input_data.hnswParams.ef,
enable_vector_integrity_check=input_data.hnswParams.enableVectorIntegrityCheck,
batching_params=types.HnswBatchingParams(
max_index_records=input_data.hnswParams.batchingParams.maxIndexRecords,
index_interval=input_data.hnswParams.batchingParams.indexInterval,
Expand Down
3 changes: 1 addition & 2 deletions src/aerospike_vector_search/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -580,8 +580,7 @@ def _to_pb2(self):
if self.max_mem_queue_size:
params.maxMemQueueSize = self.max_mem_queue_size

if self.enable_vector_integrity_check:
params.enableVectorIntegrityCheck = self.enable_vector_integrity_check
params.enableVectorIntegrityCheck = self.enable_vector_integrity_check

params.batchingParams.CopyFrom(self.batching_params._to_pb2())
params.indexCachingParams.CopyFrom(self.index_caching_params._to_pb2())
Expand Down
2 changes: 1 addition & 1 deletion tests/standard/aio/test_admin_client_index_create.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ async def test_index_create_with_sets(session_admin_client, test_case, random_na
m=32,
ef_construction=200,
ef=400,
enable_vector_integrity_check= True,
enable_vector_integrity_check= False,
),
index_labels=None,
index_storage=None,
Expand Down
3 changes: 3 additions & 0 deletions tests/standard/aio/test_admin_client_index_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ def __init__(
index_caching_params=types.HnswCachingParams(max_entries=10, expiry=3000),
merge_params=types.HnswIndexMergeParams(index_parallelism=10, reindex_parallelism=3),
healer_params=types.HnswHealerParams(max_scan_rate_per_node=80),
enable_vector_integrity_check=False,
),
timeout=None,
),
Expand Down Expand Up @@ -129,5 +130,7 @@ async def test_index_update_async(session_admin_client, test_case):
assert result["hnsw_params"]["healer_params"][
"max_scan_rate_per_node"] == test_case.hnsw_index_update.healer_params.max_scan_rate_per_node

assert result["hnsw_params"]["enable_vector_integrity_check"] == test_case.hnsw_index_update.enable_vector_integrity_check

# Clean up by dropping the index after the test
await drop_specified_index(session_admin_client, test_case.namespace, trimmed_random)
2 changes: 1 addition & 1 deletion tests/standard/sync/test_admin_client_index_create.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ def test_index_create_with_sets(session_admin_client, test_case, random_name):
m=32,
ef_construction=200,
ef=400,
enable_vector_integrity_check = True,
enable_vector_integrity_check = False,
),
index_labels=None,
index_storage=None,
Expand Down
3 changes: 3 additions & 0 deletions tests/standard/sync/test_admin_client_index_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ def __init__(
index_caching_params=types.HnswCachingParams(max_entries=10, expiry=3000),
merge_params=types.HnswIndexMergeParams(index_parallelism=10,reindex_parallelism=3),
healer_params=types.HnswHealerParams(max_scan_rate_per_node=80),
enable_vector_integrity_check=False,
),
timeout=None,
),
Expand Down Expand Up @@ -102,5 +103,7 @@ def test_index_update(session_admin_client, test_case):
if test_case.hnsw_index_update.healer_params:
assert result["hnsw_params"]["healer_params"]["max_scan_rate_per_node"] == test_case.hnsw_index_update.healer_params.max_scan_rate_per_node

assert result["hnsw_params"]["enable_vector_integrity_check"] == test_case.hnsw_index_update.enable_vector_integrity_check

# Clean up by dropping the index after the test
drop_specified_index(session_admin_client, test_case.namespace, trimmed_random)

0 comments on commit f6edd33

Please sign in to comment.