diff --git a/internal/core/src/common/Consts.h b/internal/core/src/common/Consts.h index e5ee8d6765ba7..18261a0bd542b 100644 --- a/internal/core/src/common/Consts.h +++ b/internal/core/src/common/Consts.h @@ -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"; diff --git a/internal/core/src/index/VectorDiskIndex.cpp b/internal/core/src/index/VectorDiskIndex.cpp index 73f8cb8b86204..c834db4451281 100644 --- a/internal/core/src/index/VectorDiskIndex.cpp +++ b/internal/core/src/index/VectorDiskIndex.cpp @@ -383,6 +383,14 @@ VectorDiskAnnIndex::Query(const DatasetPtr dataset, search_config[RANGE_FILTER], GetMetricType()); } + + auto page_retain_order = GetValueFromConfig( + 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()) {