Skip to content

Commit

Permalink
fix: add inverted_index_algo config for sparse index
Browse files Browse the repository at this point in the history
issue: milvus-io#39332
pr: milvus-io#39358

Signed-off-by: Shawn Wang <[email protected]>
  • Loading branch information
sparknack committed Jan 16, 2025
1 parent e752059 commit 2140e27
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions internal/core/src/segcore/IndexConfigGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,15 @@ VecIndexConfig::VecIndexConfig(const int64_t max_index_row_cout,
build_params_[knowhere::indexparam::SSIZE] = std::to_string(
std::max((int)(config_.get_chunk_rows() / config_.get_nlist()), 48));

if (is_sparse) {
auto algo_it = index_meta_.GetIndexParams().find(
knowhere::indexparam::INVERTED_INDEX_ALGO);
if (algo_it != index_meta_.GetIndexParams().end()) {
build_params_[knowhere::indexparam::INVERTED_INDEX_ALGO] =
algo_it->second;
}
}

if (is_sparse && metric_type_ == knowhere::metric::BM25) {
build_params_[knowhere::meta::BM25_K1] =
index_meta_.GetIndexParams().at(knowhere::meta::BM25_K1);
Expand Down

0 comments on commit 2140e27

Please sign in to comment.