From ea9d9578936e2be2babbbc9225664d87d68341bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9A=E5=86=9B?= Date: Tue, 3 Feb 2026 10:41:21 +0800 Subject: [PATCH] fix: some typos in hnsw index (#50) --- src/core/algorithm/hnsw/hnsw_builder.cc | 2 +- src/core/algorithm/hnsw/hnsw_context.cc | 12 ++++++------ src/core/algorithm/hnsw/hnsw_context.h | 6 +++--- src/core/algorithm/hnsw/hnsw_entity.h | 2 +- src/core/algorithm/hnsw/hnsw_searcher.cc | 14 +++++++------- src/core/algorithm/hnsw/hnsw_searcher.h | 2 +- src/core/algorithm/hnsw/hnsw_streamer.cc | 12 ++++++------ src/core/algorithm/hnsw/hnsw_streamer.h | 2 +- .../algorithm/hnsw_sparse/hnsw_sparse_context.cc | 12 ++++++------ .../algorithm/hnsw_sparse/hnsw_sparse_context.h | 6 +++--- .../algorithm/hnsw_sparse/hnsw_sparse_entity.h | 2 +- .../algorithm/hnsw_sparse/hnsw_sparse_searcher.cc | 10 +++++----- .../algorithm/hnsw_sparse/hnsw_sparse_searcher.h | 3 ++- .../algorithm/hnsw_sparse/hnsw_sparse_streamer.cc | 6 +++--- .../algorithm/hnsw_sparse/hnsw_sparse_streamer.h | 2 +- src/core/interface/index.cc | 2 +- src/core/utility/visit_filter.h | 8 ++++---- 17 files changed, 52 insertions(+), 51 deletions(-) diff --git a/src/core/algorithm/hnsw/hnsw_builder.cc b/src/core/algorithm/hnsw/hnsw_builder.cc index 73de7ae..da2d9fa 100644 --- a/src/core/algorithm/hnsw/hnsw_builder.cc +++ b/src/core/algorithm/hnsw/hnsw_builder.cc @@ -24,7 +24,7 @@ namespace zvec { namespace core { -HnswBuilder::HnswBuilder() {} +HnswBuilder::HnswBuilder() = default; int HnswBuilder::init(const IndexMeta &meta, const ailego::Params ¶ms) { LOG_INFO("Begin HnswBuilder::init"); diff --git a/src/core/algorithm/hnsw/hnsw_context.cc b/src/core/algorithm/hnsw/hnsw_context.cc index 56a5081..b930e41 100644 --- a/src/core/algorithm/hnsw/hnsw_context.cc +++ b/src/core/algorithm/hnsw/hnsw_context.cc @@ -41,7 +41,7 @@ int HnswContext::init(ContextType type) { switch (type) { case kBuilderContext: ret = visit_filter_.init(VisitFilter::ByteMap, entity_->doc_cnt(), - max_scan_num_, negative_probility_); + max_scan_num_, negative_probability_); if (ret != 0) { LOG_ERROR("Create filter failed, mode %d", filter_mode_); return ret; @@ -52,7 +52,7 @@ int HnswContext::init(ContextType type) { case kSearcherContext: ret = visit_filter_.init(filter_mode_, entity_->doc_cnt(), max_scan_num_, - negative_probility_); + negative_probability_); if (ret != 0) { LOG_ERROR("Create filter failed, mode %d", filter_mode_); return ret; @@ -68,7 +68,7 @@ int HnswContext::init(ContextType type) { max_scan_num_ = compute_max_scan_num(doc_cnt); reserve_max_doc_cnt_ = doc_cnt + compute_reserve_cnt(doc_cnt); ret = visit_filter_.init(filter_mode_, reserve_max_doc_cnt_, - max_scan_num_, negative_probility_); + max_scan_num_, negative_probability_); if (ret != 0) { LOG_ERROR("Create filter failed, mode %d", filter_mode_); return ret; @@ -111,7 +111,7 @@ int HnswContext::update(const ailego::Params ¶ms) { } } - float prob = negative_probility_; + float prob = negative_probability_; p.clear(); switch (type_) { case kSearcherContext: @@ -123,7 +123,7 @@ int HnswContext::update(const ailego::Params ¶ms) { } params.get(p, &prob); if (filter_mode_ == VisitFilter::BloomFilter && - std::abs(prob - negative_probility_) > 1e-6) { + std::abs(prob - negative_probability_) > 1e-6) { need_update = true; } if (need_update) { @@ -135,7 +135,7 @@ int HnswContext::update(const ailego::Params ¶ms) { max_doc_cnt = reserve_max_doc_cnt_; } int ret = visit_filter_.init(filter_mode_, max_doc_cnt, max_scan_num_, - negative_probility_); + negative_probability_); if (ret != 0) { LOG_ERROR("Create filter failed, mode %d", filter_mode_); return ret; diff --git a/src/core/algorithm/hnsw/hnsw_context.h b/src/core/algorithm/hnsw/hnsw_context.h index 3358e86..22bcfaa 100644 --- a/src/core/algorithm/hnsw/hnsw_context.h +++ b/src/core/algorithm/hnsw/hnsw_context.h @@ -301,8 +301,8 @@ class HnswContext : public IndexContext { filter_mode_ = v; } - inline void set_filter_negative_probility(float v) { - negative_probility_ = v; + inline void set_filter_negative_probability(float v) { + negative_probability_ = v; } inline void set_max_scan_ratio(float v) { @@ -501,7 +501,7 @@ class HnswContext : public IndexContext { uint32_t topk_{0}; uint32_t group_topk_{0}; uint32_t filter_mode_{VisitFilter::ByteMap}; - float negative_probility_{HnswEntity::kDefaultBFNegativeProbility}; + float negative_probability_{HnswEntity::kDefaultBFNegativeProbability}; uint32_t ef_{HnswEntity::kDefaultEf}; float max_scan_ratio_{HnswEntity::kDefaultScanRatio}; uint32_t magic_{0U}; diff --git a/src/core/algorithm/hnsw/hnsw_entity.h b/src/core/algorithm/hnsw/hnsw_entity.h index 363a725..e5f2077 100644 --- a/src/core/algorithm/hnsw/hnsw_entity.h +++ b/src/core/algorithm/hnsw/hnsw_entity.h @@ -506,7 +506,7 @@ class HnswEntity { constexpr static uint32_t kDefaultMinScanLimit = 10000; constexpr static uint32_t kDefaultMaxScanLimit = std::numeric_limits::max(); - constexpr static float kDefaultBFNegativeProbility = 0.001f; + constexpr static float kDefaultBFNegativeProbability = 0.001f; constexpr static uint32_t kDefaultScalingFactor = 50U; constexpr static uint32_t kDefaultBruteForceThreshold = 1000U; constexpr static uint32_t kDefaultDocsHardLimit = 1 << 30U; // 1 billion diff --git a/src/core/algorithm/hnsw/hnsw_searcher.cc b/src/core/algorithm/hnsw/hnsw_searcher.cc index 2e06687..a2c851d 100644 --- a/src/core/algorithm/hnsw/hnsw_searcher.cc +++ b/src/core/algorithm/hnsw/hnsw_searcher.cc @@ -19,9 +19,9 @@ namespace zvec { namespace core { -HnswSearcher::HnswSearcher() {} +HnswSearcher::HnswSearcher() = default; -HnswSearcher::~HnswSearcher() {} +HnswSearcher::~HnswSearcher() = default; int HnswSearcher::init(const ailego::Params &search_params) { params_ = search_params; @@ -32,7 +32,7 @@ int HnswSearcher::init(const ailego::Params &search_params) { params_.get(PARAM_HNSW_SEARCHER_NEIGHBORS_IN_MEMORY_ENABLE, &neighbors_in_memory_enabled_); params_.get(PARAM_HNSW_SEARCHER_VISIT_BLOOMFILTER_NEGATIVE_PROB, - &bf_negative_probility_); + &bf_negative_probability_); params_.get(PARAM_HNSW_SEARCHER_BRUTE_FORCE_THRESHOLD, &bruteforce_threshold_); params_.get(PARAM_HNSW_SEARCHER_FORCE_PADDING_RESULT_ENABLE, @@ -41,7 +41,7 @@ int HnswSearcher::init(const ailego::Params &search_params) { if (ef_ == 0) { ef_ = HnswEntity::kDefaultEf; } - if (bf_negative_probility_ <= 0.0f || bf_negative_probility_ >= 1.0f) { + if (bf_negative_probability_ <= 0.0f || bf_negative_probability_ >= 1.0f) { LOG_ERROR("[%s] must be in range (0,1)", PARAM_HNSW_SEARCHER_VISIT_BLOOMFILTER_NEGATIVE_PROB.c_str()); return IndexError_InvalidArgument; @@ -56,7 +56,7 @@ int HnswSearcher::init(const ailego::Params &search_params) { "neighborsInMemoryEnabled=%u bfNagtiveProb=%f bruteForceThreshold=%u " "forcePadding=%u", ef_, max_scan_ratio_, bf_enabled_, check_crc_enabled_, - neighbors_in_memory_enabled_, bf_negative_probility_, + neighbors_in_memory_enabled_, bf_negative_probability_, bruteforce_threshold_, force_padding_topk_enabled_); return 0; @@ -90,7 +90,7 @@ int HnswSearcher::cleanup() { max_scan_num_ = 0U; ef_ = HnswEntity::kDefaultEf; bf_enabled_ = false; - bf_negative_probility_ = HnswEntity::kDefaultBFNegativeProbility; + bf_negative_probability_ = HnswEntity::kDefaultBFNegativeProbability; bruteforce_threshold_ = HnswEntity::kDefaultBruteForceThreshold; check_crc_enabled_ = false; neighbors_in_memory_enabled_ = false; @@ -425,7 +425,7 @@ IndexSearcher::Context::Pointer HnswSearcher::create_context() const { uint32_t filter_mode = bf_enabled_ ? VisitFilter::BloomFilter : VisitFilter::ByteMap; ctx->set_filter_mode(filter_mode); - ctx->set_filter_negative_probility(bf_negative_probility_); + ctx->set_filter_negative_probability(bf_negative_probability_); ctx->set_magic(magic_); ctx->set_force_padding_topk(force_padding_topk_enabled_); ctx->set_bruteforce_threshold(bruteforce_threshold_); diff --git a/src/core/algorithm/hnsw/hnsw_searcher.h b/src/core/algorithm/hnsw/hnsw_searcher.h index 4c8a314..d79526d 100644 --- a/src/core/algorithm/hnsw/hnsw_searcher.h +++ b/src/core/algorithm/hnsw/hnsw_searcher.h @@ -129,7 +129,7 @@ class HnswSearcher : public IndexSearcher { bool check_crc_enabled_{false}; bool neighbors_in_memory_enabled_{false}; bool force_padding_topk_enabled_{false}; - float bf_negative_probility_{HnswEntity::kDefaultBFNegativeProbility}; + float bf_negative_probability_{HnswEntity::kDefaultBFNegativeProbability}; uint32_t magic_{0U}; State state_{STATE_INIT}; diff --git a/src/core/algorithm/hnsw/hnsw_streamer.cc b/src/core/algorithm/hnsw/hnsw_streamer.cc index be01f5d..5804c7d 100644 --- a/src/core/algorithm/hnsw/hnsw_streamer.cc +++ b/src/core/algorithm/hnsw/hnsw_streamer.cc @@ -175,7 +175,7 @@ int HnswStreamer::init(const IndexMeta &imeta, const ailego::Params ¶ms) { "Init params: maxIndexSize=%zu docsHardLimit=%zu docsSoftLimit=%zu " "efConstruction=%u ef=%u upperMaxNeighborCnt=%u l0MaxNeighborCnt=%u " "scalingFactor=%u maxScanRatio=%.3f minScanLimit=%zu maxScanLimit=%zu " - "bfEnabled=%d bruteFoceThreshold=%zu bfNegativeProbility=%.5f " + "bfEnabled=%d bruteFoceThreshold=%zu bfNegativeProbability=%.5f " "checkCrcEnabled=%d pruneSize=%zu vectorSize=%u chunkSize=%zu " "filterSameKey=%u getVectorEnabled=%u minNeighborCount=%u " "forcePadding=%u ", @@ -227,7 +227,7 @@ int HnswStreamer::cleanup(void) { max_scan_limit_ = HnswEntity::kDefaultMaxScanLimit; min_scan_limit_ = HnswEntity::kDefaultMinScanLimit; chunk_size_ = HnswEntity::kDefaultChunkSize; - bf_negative_prob_ = HnswEntity::kDefaultBFNegativeProbility; + bf_negative_prob_ = HnswEntity::kDefaultBFNegativeProbability; max_scan_ratio_ = HnswEntity::kDefaultScanRatio; state_ = STATE_INIT; check_crc_enabled_ = false; @@ -281,7 +281,7 @@ int HnswStreamer::open(IndexStorage::Pointer stg) { } ret = metric_->init(meta_, meta_.metric_params()); if (ret != 0) { - LOG_ERROR("Failled to init metric, ret=%d", ret); + LOG_ERROR("Failed to init metric, ret=%d", ret); return ret; } @@ -375,7 +375,7 @@ IndexStreamer::Context::Pointer HnswStreamer::create_context(void) const { ctx->set_max_scan_ratio(max_scan_ratio_); ctx->set_filter_mode(bf_enabled_ ? VisitFilter::BloomFilter : VisitFilter::ByteMap); - ctx->set_filter_negative_probility(bf_negative_prob_); + ctx->set_filter_negative_probability(bf_negative_prob_); ctx->set_magic(magic_); ctx->set_force_padding_topk(force_padding_topk_enabled_); ctx->set_bruteforce_threshold(bruteforce_threshold_); @@ -488,7 +488,7 @@ int HnswStreamer::add_with_id_impl(uint32_t id, const void *query, ret = alg_->add_node(id, level, ctx); if (ailego_unlikely(ret != 0)) { - LOG_ERROR("Hnsw stramer add node failed"); + LOG_ERROR("Hnsw steamer add node failed"); (*stats_.mutable_discarded_count())++; return ret; } @@ -569,7 +569,7 @@ int HnswStreamer::add_impl(uint64_t pkey, const void *query, ret = alg_->add_node(id, level, ctx); if (ailego_unlikely(ret != 0)) { - LOG_ERROR("Hnsw stramer add node failed"); + LOG_ERROR("Hnsw steamer add node failed"); (*stats_.mutable_discarded_count())++; return ret; } diff --git a/src/core/algorithm/hnsw/hnsw_streamer.h b/src/core/algorithm/hnsw/hnsw_streamer.h index daadd8d..b81106d 100644 --- a/src/core/algorithm/hnsw/hnsw_streamer.h +++ b/src/core/algorithm/hnsw/hnsw_streamer.h @@ -208,7 +208,7 @@ class HnswStreamer : public IndexStreamer { size_t bruteforce_threshold_{HnswEntity::kDefaultBruteForceThreshold}; size_t max_scan_limit_{HnswEntity::kDefaultMaxScanLimit}; size_t min_scan_limit_{HnswEntity::kDefaultMinScanLimit}; - float bf_negative_prob_{HnswEntity::kDefaultBFNegativeProbility}; + float bf_negative_prob_{HnswEntity::kDefaultBFNegativeProbability}; float max_scan_ratio_{HnswEntity::kDefaultScanRatio}; uint32_t magic_{0U}; diff --git a/src/core/algorithm/hnsw_sparse/hnsw_sparse_context.cc b/src/core/algorithm/hnsw_sparse/hnsw_sparse_context.cc index 7cad11f..de3dfdd 100644 --- a/src/core/algorithm/hnsw_sparse/hnsw_sparse_context.cc +++ b/src/core/algorithm/hnsw_sparse/hnsw_sparse_context.cc @@ -35,7 +35,7 @@ int HnswSparseContext::init(ContextType type) { switch (type) { case kSparseBuilderContext: ret = visit_filter_.init(VisitFilter::ByteMap, entity_->doc_cnt(), - max_scan_num_, negative_probility_); + max_scan_num_, negative_probability_); if (ret != 0) { LOG_ERROR("Create filter failed, mode %d", filter_mode_); return ret; @@ -46,7 +46,7 @@ int HnswSparseContext::init(ContextType type) { case kSparseSearcherContext: ret = visit_filter_.init(filter_mode_, entity_->doc_cnt(), max_scan_num_, - negative_probility_); + negative_probability_); if (ret != 0) { LOG_ERROR("Create filter failed, mode %d", filter_mode_); return ret; @@ -62,7 +62,7 @@ int HnswSparseContext::init(ContextType type) { max_scan_num_ = compute_max_scan_num(doc_cnt); reserve_max_doc_cnt_ = doc_cnt + compute_reserve_cnt(doc_cnt); ret = visit_filter_.init(filter_mode_, reserve_max_doc_cnt_, - max_scan_num_, negative_probility_); + max_scan_num_, negative_probability_); if (ret != 0) { LOG_ERROR("Create filter failed, mode %d", filter_mode_); return ret; @@ -107,7 +107,7 @@ int HnswSparseContext::update(const ailego::Params ¶ms) { } } - float prob = negative_probility_; + float prob = negative_probability_; p.clear(); switch (type_) { case kSparseSearcherContext: @@ -119,7 +119,7 @@ int HnswSparseContext::update(const ailego::Params ¶ms) { } params.get(p, &prob); if (filter_mode_ == VisitFilter::BloomFilter && - std::abs(prob - negative_probility_) > 1e-6) { + std::abs(prob - negative_probability_) > 1e-6) { need_update = true; } if (need_update) { @@ -131,7 +131,7 @@ int HnswSparseContext::update(const ailego::Params ¶ms) { max_doc_cnt = reserve_max_doc_cnt_; } int ret = visit_filter_.init(filter_mode_, max_doc_cnt, max_scan_num_, - negative_probility_); + negative_probability_); if (ret != 0) { LOG_ERROR("Create filter failed, mode %d", filter_mode_); return ret; diff --git a/src/core/algorithm/hnsw_sparse/hnsw_sparse_context.h b/src/core/algorithm/hnsw_sparse/hnsw_sparse_context.h index 04a0a3b..d8ef2fe 100644 --- a/src/core/algorithm/hnsw_sparse/hnsw_sparse_context.h +++ b/src/core/algorithm/hnsw_sparse/hnsw_sparse_context.h @@ -297,8 +297,8 @@ class HnswSparseContext : public IndexContext { filter_mode_ = v; } - inline void set_filter_negative_probility(float v) { - negative_probility_ = v; + inline void set_filter_negative_probability(float v) { + negative_probability_ = v; } inline void set_max_scan_ratio(float v) { @@ -494,7 +494,7 @@ class HnswSparseContext : public IndexContext { uint32_t topk_{0}; uint32_t group_topk_{0}; uint32_t filter_mode_{VisitFilter::ByteMap}; - float negative_probility_{HnswSparseEntity::kDefaultBFNegativeProbility}; + float negative_probability_{HnswSparseEntity::kDefaultBFNegativeProbability}; uint32_t ef_{HnswSparseEntity::kDefaultEf}; float max_scan_ratio_{HnswSparseEntity::kDefaultScanRatio}; uint32_t magic_{0U}; diff --git a/src/core/algorithm/hnsw_sparse/hnsw_sparse_entity.h b/src/core/algorithm/hnsw_sparse/hnsw_sparse_entity.h index 7e6c16e..3716602 100644 --- a/src/core/algorithm/hnsw_sparse/hnsw_sparse_entity.h +++ b/src/core/algorithm/hnsw_sparse/hnsw_sparse_entity.h @@ -595,7 +595,7 @@ class HnswSparseEntity { constexpr static uint32_t kDefaultMinScanLimit = 10000; constexpr static uint32_t kDefaultMaxScanLimit = std::numeric_limits::max(); - constexpr static float kDefaultBFNegativeProbility = 0.001f; + constexpr static float kDefaultBFNegativeProbability = 0.001f; constexpr static uint32_t kDefaultScalingFactor = 50U; constexpr static uint32_t kDefaultBruteForceThreshold = 1000U; constexpr static uint32_t kDefaultDocsHardLimit = 1 << 30U; // 1 billion diff --git a/src/core/algorithm/hnsw_sparse/hnsw_sparse_searcher.cc b/src/core/algorithm/hnsw_sparse/hnsw_sparse_searcher.cc index 9f1ee66..7e7ea73 100644 --- a/src/core/algorithm/hnsw_sparse/hnsw_sparse_searcher.cc +++ b/src/core/algorithm/hnsw_sparse/hnsw_sparse_searcher.cc @@ -33,7 +33,7 @@ int HnswSparseSearcher::init(const ailego::Params &search_params) { params_.get(PARAM_HNSW_SPARSE_SEARCHER_NEIGHBORS_IN_MEMORY_ENABLE, &neighbors_in_memory_enabled_); params_.get(PARAM_HNSW_SPARSE_SEARCHER_VISIT_BLOOMFILTER_NEGATIVE_PROB, - &bf_negative_probility_); + &bf_negative_probability_); params_.get(PARAM_HNSW_SPARSE_SEARCHER_BRUTE_FORCE_THRESHOLD, &bruteforce_threshold_); params_.get(PARAM_HNSW_SPARSE_SEARCHER_FORCE_PADDING_RESULT_ENABLE, @@ -46,7 +46,7 @@ int HnswSparseSearcher::init(const ailego::Params &search_params) { if (ef_ == 0) { ef_ = HnswSparseEntity::kDefaultEf; } - if (bf_negative_probility_ <= 0.0f || bf_negative_probility_ >= 1.0f) { + if (bf_negative_probability_ <= 0.0f || bf_negative_probability_ >= 1.0f) { LOG_ERROR( "[%s] must be in range (0,1)", PARAM_HNSW_SPARSE_SEARCHER_VISIT_BLOOMFILTER_NEGATIVE_PROB.c_str()); @@ -69,7 +69,7 @@ int HnswSparseSearcher::init(const ailego::Params &search_params) { "neighborsInMemoryEnabled=%u bfNagtiveProb=%f bruteForceThreshold=%u " "forcePadding=%u filteringRatio=%f", ef_, max_scan_ratio_, bf_enabled_, check_crc_enabled_, - neighbors_in_memory_enabled_, bf_negative_probility_, + neighbors_in_memory_enabled_, bf_negative_probability_, bruteforce_threshold_, force_padding_topk_enabled_, query_filtering_ratio_); @@ -104,7 +104,7 @@ int HnswSparseSearcher::cleanup() { max_scan_num_ = 0U; ef_ = HnswSparseEntity::kDefaultEf; bf_enabled_ = false; - bf_negative_probility_ = HnswSparseEntity::kDefaultBFNegativeProbility; + bf_negative_probability_ = HnswSparseEntity::kDefaultBFNegativeProbability; bruteforce_threshold_ = HnswSparseEntity::kDefaultBruteForceThreshold; check_crc_enabled_ = false; neighbors_in_memory_enabled_ = false; @@ -524,7 +524,7 @@ IndexSearcher::Context::Pointer HnswSparseSearcher::create_context() const { uint32_t filter_mode = bf_enabled_ ? VisitFilter::BloomFilter : VisitFilter::ByteMap; ctx->set_filter_mode(filter_mode); - ctx->set_filter_negative_probility(bf_negative_probility_); + ctx->set_filter_negative_probability(bf_negative_probability_); ctx->set_magic(magic_); ctx->set_force_padding_topk(force_padding_topk_enabled_); ctx->set_bruteforce_threshold(bruteforce_threshold_); diff --git a/src/core/algorithm/hnsw_sparse/hnsw_sparse_searcher.h b/src/core/algorithm/hnsw_sparse/hnsw_sparse_searcher.h index 5cb3db6..0f269a5 100644 --- a/src/core/algorithm/hnsw_sparse/hnsw_sparse_searcher.h +++ b/src/core/algorithm/hnsw_sparse/hnsw_sparse_searcher.h @@ -144,7 +144,8 @@ class HnswSparseSearcher : public IndexSearcher { bool check_crc_enabled_{false}; bool neighbors_in_memory_enabled_{false}; bool force_padding_topk_enabled_{false}; - float bf_negative_probility_{HnswSparseEntity::kDefaultBFNegativeProbility}; + float bf_negative_probability_{ + HnswSparseEntity::kDefaultBFNegativeProbability}; bool query_filtering_enabled_{false}; float query_filtering_ratio_{HnswSparseEntity::kDefaultQueryFilteringRatio}; diff --git a/src/core/algorithm/hnsw_sparse/hnsw_sparse_streamer.cc b/src/core/algorithm/hnsw_sparse/hnsw_sparse_streamer.cc index 26b402d..f51ebb5 100644 --- a/src/core/algorithm/hnsw_sparse/hnsw_sparse_streamer.cc +++ b/src/core/algorithm/hnsw_sparse/hnsw_sparse_streamer.cc @@ -191,7 +191,7 @@ int HnswSparseStreamer::init(const IndexMeta &imeta, "Init params: maxIndexSize=%zu docsHardLimit=%zu docsSoftLimit=%zu " "efConstruction=%u ef=%u l0NeighborCnt=%u upperNeighborCnt=%u " "scalingFactor=%u maxScanRatio=%.3f minScanLimit=%zu maxScanLimit=%zu " - "bfEnabled=%d bruteFoceThreshold=%zu bfNegativeProbility=%.5f " + "bfEnabled=%d bruteFoceThreshold=%zu bfNegativeProbability=%.5f " "checkCrcEnabled=%d pruneSize=%zu chunkSize=%zu " "filterSameKey=%u getVectorEnabled=%u " "minNeighborCount=%u forcePadding=%u filteringRatio=%f", @@ -242,7 +242,7 @@ int HnswSparseStreamer::cleanup(void) { max_scan_limit_ = HnswSparseEntity::kDefaultMaxScanLimit; min_scan_limit_ = HnswSparseEntity::kDefaultMinScanLimit; chunk_size_ = HnswSparseEntity::kDefaultChunkSize; - bf_negative_prob_ = HnswSparseEntity::kDefaultBFNegativeProbility; + bf_negative_prob_ = HnswSparseEntity::kDefaultBFNegativeProbability; max_scan_ratio_ = HnswSparseEntity::kDefaultScanRatio; state_ = STATE_INIT; check_crc_enabled_ = false; @@ -384,7 +384,7 @@ IndexStreamer::Context::Pointer HnswSparseStreamer::create_context(void) const { ctx->set_max_scan_ratio(max_scan_ratio_); ctx->set_filter_mode(bf_enabled_ ? VisitFilter::BloomFilter : VisitFilter::ByteMap); - ctx->set_filter_negative_probility(bf_negative_prob_); + ctx->set_filter_negative_probability(bf_negative_prob_); ctx->set_magic(magic_); ctx->set_force_padding_topk(force_padding_topk_enabled_); ctx->set_bruteforce_threshold(bruteforce_threshold_); diff --git a/src/core/algorithm/hnsw_sparse/hnsw_sparse_streamer.h b/src/core/algorithm/hnsw_sparse/hnsw_sparse_streamer.h index fcdcbe5..fa2712b 100644 --- a/src/core/algorithm/hnsw_sparse/hnsw_sparse_streamer.h +++ b/src/core/algorithm/hnsw_sparse/hnsw_sparse_streamer.h @@ -200,7 +200,7 @@ class HnswSparseStreamer : public IndexStreamer { size_t bruteforce_threshold_{HnswSparseEntity::kDefaultBruteForceThreshold}; size_t max_scan_limit_{HnswSparseEntity::kDefaultMaxScanLimit}; size_t min_scan_limit_{HnswSparseEntity::kDefaultMinScanLimit}; - float bf_negative_prob_{HnswSparseEntity::kDefaultBFNegativeProbility}; + float bf_negative_prob_{HnswSparseEntity::kDefaultBFNegativeProbability}; float max_scan_ratio_{HnswSparseEntity::kDefaultScanRatio}; float sparse_neighbor_ratio_{HnswSparseEntity::kDefaultSparseNeighborRatio}; uint32_t sparse_neighbor_cnt_{0UL}; diff --git a/src/core/interface/index.cc b/src/core/interface/index.cc index aca4094..038f67d 100644 --- a/src/core/interface/index.cc +++ b/src/core/interface/index.cc @@ -601,7 +601,7 @@ int Index::_dense_search(const VectorData &vector_data, } // TODO: group by if (search_param->bf_pks != nullptr) { - // should we elimate the copy of bf_pks? + // should we eliminate the copy of bf_pks? if (streamer_->search_bf_by_p_keys_impl( vector, std::vector>{*search_param->bf_pks}, new_meta, 1, context) != 0) { diff --git a/src/core/utility/visit_filter.h b/src/core/utility/visit_filter.h index 348da17..ea76c14 100644 --- a/src/core/utility/visit_filter.h +++ b/src/core/utility/visit_filter.h @@ -218,7 +218,7 @@ class VisitBitMap { template static int init(Context *, void **ctx, uint64_t maxDocCnt, uint64_t maxScanNum, std::tuple &&tpl) { - (void)tpl; // unsed warning + (void)tpl; // unused warning Context *c = new (std::nothrow) Context; if (c == nullptr) { LOG_ERROR("New memory in initVisitBitMap failed"); @@ -312,7 +312,7 @@ class VisitByteMap { template static int init(Context *, void **ctx, uint64_t maxDocCnt, uint64_t maxScanNum, std::tuple &&tpl) { - (void)tpl; // unsed warning + (void)tpl; // unused warning Context *c = new (std::nothrow) Context; if (c == nullptr) { LOG_ERROR("New memory in initVisitByteMap failed"); @@ -403,10 +403,10 @@ class VisitFilter { } int init(int mode, uint64_t maxDocCnt, uint64_t maxScanNum, - float negativeProbility) { + float negativeProbability) { mode_ = mode; PROXIMA_HNSW_VISITFILTER_CALL_IMPL(init, &ctx_, maxDocCnt, maxScanNum, - std::make_tuple(negativeProbility)); + std::make_tuple(negativeProbability)); return 0; // place holder }