Skip to content

Commit

Permalink
feat: [2.4] support range search pagination retains order (#35739)
Browse files Browse the repository at this point in the history
issue: #35464
pr: #35738
  • Loading branch information
PwzXxm authored Aug 29, 2024
1 parent 50ec3dd commit 5da64f6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions internal/core/src/common/Consts.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ const char OFFSET_MAPPING_NAME[] = "offset_mapping";
const char NUM_CLUSTERS[] = "num_clusters";
const char KMEANS_CLUSTER[] = "KMEANS";
const char VEC_OPT_FIELDS[] = "opt_fields";
const char PAGE_RETAIN_ORDER[] = "page_retain_order";

const char DEFAULT_PLANNODE_ID[] = "0";
const char DEAFULT_QUERY_ID[] = "0";
Expand Down
8 changes: 8 additions & 0 deletions internal/core/src/index/VectorDiskIndex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,14 @@ VectorDiskAnnIndex<T>::Query(const DatasetPtr dataset,
search_config[RANGE_FILTER],
GetMetricType());
}

auto page_retain_order = GetValueFromConfig<bool>(
search_info.search_params_, PAGE_RETAIN_ORDER);
if (page_retain_order.has_value()) {
search_config[knowhere::meta::RETAIN_ITERATOR_ORDER] =
page_retain_order.value();
}

auto res = index_.RangeSearch(dataset, search_config, bitset);

if (!res.has_value()) {
Expand Down

0 comments on commit 5da64f6

Please sign in to comment.