Skip to content

Commit

Permalink
sparse: set the default value of refine_factor to 1
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
sparknack committed Jan 15, 2025
1 parent 45d757c commit 74baa01
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/index/sparse/sparse_inverted_index_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
/**
Expand Down

0 comments on commit 74baa01

Please sign in to comment.