feat: [2.4] support range search pagination retains order (#35739)

issue: https://github.com/milvus-io/milvus/issues/35464
pr: https://github.com/milvus-io/milvus/pull/35738
pull/35817/head
Patrick Weizhi Xu 2024-08-29 14:07:01 +08:00 committed by GitHub
parent 50ec3dd4db
commit 5da64f6d5a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 0 deletions

View File

@ -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";

View File

@ -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()) {