mirror of https://github.com/milvus-io/milvus.git
fix: sparse: add inverted_index_algo and dim_max_score_ratio config (#39362)
issue: #39332 pr: #39358 Signed-off-by: Shawn Wang <shawn.wang@zilliz.com>pull/39414/head
parent
f704e3edef
commit
57bcb1bfc0
|
@ -43,13 +43,24 @@ 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 && metric_type_ == knowhere::metric::BM25) {
|
||||
build_params_[knowhere::meta::BM25_K1] =
|
||||
index_meta_.GetIndexParams().at(knowhere::meta::BM25_K1);
|
||||
build_params_[knowhere::meta::BM25_B] =
|
||||
index_meta_.GetIndexParams().at(knowhere::meta::BM25_B);
|
||||
build_params_[knowhere::meta::BM25_AVGDL] =
|
||||
index_meta_.GetIndexParams().at(knowhere::meta::BM25_AVGDL);
|
||||
if (is_sparse) {
|
||||
const auto& index_params = index_meta_.GetIndexParams();
|
||||
|
||||
if (auto algo_it =
|
||||
index_params.find(knowhere::indexparam::INVERTED_INDEX_ALGO);
|
||||
algo_it != index_params.end()) {
|
||||
build_params_[knowhere::indexparam::INVERTED_INDEX_ALGO] =
|
||||
algo_it->second;
|
||||
}
|
||||
|
||||
if (metric_type_ == knowhere::metric::BM25) {
|
||||
build_params_[knowhere::meta::BM25_K1] =
|
||||
index_params.at(knowhere::meta::BM25_K1);
|
||||
build_params_[knowhere::meta::BM25_B] =
|
||||
index_params.at(knowhere::meta::BM25_B);
|
||||
build_params_[knowhere::meta::BM25_AVGDL] =
|
||||
index_params.at(knowhere::meta::BM25_AVGDL);
|
||||
}
|
||||
}
|
||||
|
||||
search_params_[knowhere::indexparam::NPROBE] =
|
||||
|
|
|
@ -34,7 +34,7 @@ class VecIndexConfig {
|
|||
{knowhere::IndexEnum::INDEX_FAISS_IVFFLAT_CC, 0.1}};
|
||||
|
||||
inline static const std::unordered_set<std::string> maintain_params = {
|
||||
"radius", "range_filter", "drop_ratio_search"};
|
||||
"radius", "range_filter", "drop_ratio_search", "dim_max_score_ratio"};
|
||||
|
||||
public:
|
||||
VecIndexConfig(const int64_t max_index_row_count,
|
||||
|
|
Loading…
Reference in New Issue