diff --git a/.vscode/launch.json b/.vscode/launch.json index 87c57a520..e3a551237 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -74,6 +74,7 @@ "--logfile", "./hdfimport.log", "--loglevel", "DEBUG" ], + "justMyCode": false, "console": "integratedTerminal" }, { diff --git a/aerospike/aerospikehdf.py b/aerospike/aerospikehdf.py index dcee38cc8..7fd219743 100644 --- a/aerospike/aerospikehdf.py +++ b/aerospike/aerospikehdf.py @@ -260,13 +260,14 @@ async def create_index(self, adminClient: vectorASyncAdminClient) -> None: global aerospikeIdxNames self.print_log(f'Creating Index {self._idx_namespace}.{self._idx_name}') s = time.time() - await adminClient.index_create(namespace=self._idx_namespace, + await adminClient.index_create(namespace=self._namespace, name=self._idx_name, sets=self._setName, vector_field=self._idx_binName, dimensions=self._dimensions, index_params= self._idx_hnswparams, - vector_distance_metric=self._idx_distance + vector_distance_metric=self._idx_distance, + index_storage= vectorTypes.IndexStorage(namespace=self._idx_namespace) ) t = time.time() self.print_log(f'Index Creation Time (sec) = {t - s}') @@ -373,6 +374,8 @@ async def index_exist(self, adminClient: vectorASyncAdminClient) -> Union[dict, indexInfo = [(index if index["id"]["namespace"] == self._idx_namespace and index["id"]["name"] == self._idx_name else None) for index in existingIndexes] + if len(indexInfo) == 1 and indexInfo[0] is None: + return None return next(i for i in indexInfo if i is not None) async def populate(self) -> None: diff --git a/aerospike/baseaerospike.py b/aerospike/baseaerospike.py index 564a60948..bd7e61a46 100644 --- a/aerospike/baseaerospike.py +++ b/aerospike/baseaerospike.py @@ -467,7 +467,7 @@ def hnswstr(self) -> str: if self._idx_hnswparams.batching_params is None: batchingparams = '' else: - batchingparams = f"maxrecs:{self._idx_hnswparams.batching_params.max_records}, interval:{self._idx_hnswparams.batching_params.interval}, disabled:{self._idx_hnswparams.batching_params.disabled}" + batchingparams = f"maxrecs:{self._idx_hnswparams.batching_params.max_records}, interval:{self._idx_hnswparams.batching_params.interval}" return f"m:{self._idx_hnswparams.m}, efconst:{self._idx_hnswparams.ef_construction}, ef:{self._idx_hnswparams.ef}, batching:{{{batchingparams}}}" def basestring(self) -> str: diff --git a/ann_benchmarks/algorithms/aerospike/module.py b/ann_benchmarks/algorithms/aerospike/module.py index 6ae8fcd6f..fb9137265 100644 --- a/ann_benchmarks/algorithms/aerospike/module.py +++ b/ann_benchmarks/algorithms/aerospike/module.py @@ -426,6 +426,6 @@ def query(self, q, n): # return self.batch_latencies def __str__(self): - batchingparams = f"maxrecs:{self._idx_hnswparams.batching_params.max_records}, interval:{self._idx_hnswparams.batching_params.interval}, disabled:{self._idx_hnswparams.batching_params.disabled}" + batchingparams = f"maxrecs:{self._idx_hnswparams.batching_params.max_records}, interval:{self._idx_hnswparams.batching_params.interval}" hnswparams = f"m:{self._idx_hnswparams.m}, efconst:{self._idx_hnswparams.ef_construction}, ef:{self._idx_hnswparams.ef}, batching:{{{batchingparams}}}" return f"Aerospike([{self._metric}, {self._host}:{self._port}, {self._isloadbalancer}, {self._namespace}.{self._setName}.{self._idx_name}, {self._idx_type}, {self._idx_value}, {self._dims}, {self._actions}, {self._idx_sleep}, {self._populateTasks}, {{{hnswparams}}}, {{{self._query_hnswsearchparams}}}])"