From a5d337368d93ecbf17b21ca8a1c6b1391bd86525 Mon Sep 17 00:00:00 2001 From: Shawn Wang Date: Wed, 15 Jan 2025 23:41:41 +0800 Subject: [PATCH] sparse: make the default value of refine_factor to 1 Because of the removal of forward index, the current refine searching is slower than before. To prevent performance degradation when using a non-zero value of drop_ratio_search, set the default value of refine_factor to 1. Signed-off-by: Shawn Wang --- src/index/sparse/sparse_inverted_index_config.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/index/sparse/sparse_inverted_index_config.h b/src/index/sparse/sparse_inverted_index_config.h index 9b14e5aa6..5c1528f88 100644 --- a/src/index/sparse/sparse_inverted_index_config.h +++ b/src/index/sparse/sparse_inverted_index_config.h @@ -38,9 +38,19 @@ class SparseInvertedIndexConfig : public BaseConfig { .for_search() .for_range_search() .for_iterator(); + /** + * refine_factor is used for approximate search. + * refine_factor == 1 means no refinement, and is the default value. + * refine_factor > 1 means refinement. The larger the value, the more + * accurate the approximate result will be, but the slower the + * performance. + * Be aware that if you opt to use a large drop_ratio_search, it is + * necessary for you to manually modify this value. + */ KNOWHERE_CONFIG_DECLARE_FIELD(refine_factor) .description("refine factor") - .set_default(10) + .set_default(1) + .set_range(1, 10, true, true) .for_search() .for_range_search(); /**