File tree Expand file tree Collapse file tree 3 files changed +41
-1
lines changed
server/src/main/java/org/elasticsearch
x-pack/plugin/rank-rrf/src/yamlRestTest/resources/rest-api-spec/test/rrf Expand file tree Collapse file tree 3 files changed +41
-1
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,9 @@ private SearchCapabilities() {}
3636 /** knn query where k defaults to the request size. */
3737 private static final String K_DEFAULT_TO_SIZE = "k_default_to_size" ;
3838
39+ /** Support deprecated window_size field in rank. */
40+ private static final String RRF_WINDOW_SIZE_SUPPORT_DEPRECATED = "rrf_window_size_support_deprecated" ;
41+
3942 private static final String RANDOM_SAMPLER_WITH_SCORED_SUBAGGS = "random_sampler_with_scored_subaggs" ;
4043 private static final String OPTIMIZED_SCALAR_QUANTIZATION_BBQ = "optimized_scalar_quantization_bbq" ;
4144 private static final String KNN_QUANTIZED_VECTOR_RESCORE_OVERSAMPLE = "knn_quantized_vector_rescore_oversample" ;
@@ -54,6 +57,7 @@ private SearchCapabilities() {}
5457 capabilities .add (MOVING_FN_RIGHT_MATH );
5558 capabilities .add (K_DEFAULT_TO_SIZE );
5659 capabilities .add (KQL_QUERY_SUPPORTED );
60+ capabilities .add (RRF_WINDOW_SIZE_SUPPORT_DEPRECATED );
5761 CAPABILITIES = Set .copyOf (capabilities );
5862 }
5963}
Original file line number Diff line number Diff line change 3535 */
3636public abstract class RankBuilder implements VersionedNamedWriteable , ToXContentObject {
3737
38- public static final ParseField RANK_WINDOW_SIZE_FIELD = new ParseField ("rank_window_size" );
38+ public static final ParseField RANK_WINDOW_SIZE_FIELD = new ParseField ("rank_window_size" , "window_size" );
3939
4040 public static final int DEFAULT_RANK_WINDOW_SIZE = SearchService .DEFAULT_SIZE ;
4141
Original file line number Diff line number Diff line change @@ -100,6 +100,42 @@ setup:
100100 - match : { hits.hits.2.fields.text.0: "other" }
101101 - match : { hits.hits.2.fields.keyword.0: "other" }
102102
103+ ---
104+ " Simple rank with old window_size param " :
105+
106+ - requires :
107+ capabilities :
108+ - method : POST
109+ path : /_search
110+ capabilities : [ rrf_window_size_support_deprecated ]
111+ test_runner_features : capabilities
112+ reason : " add deprecated field [window_size] back to support upgrade"
113+ - do :
114+ warnings :
115+ - " Deprecated field [rank] used, replaced by [retriever]"
116+ - " Deprecated field [window_size] used, expected [rank_window_size] instead"
117+ search :
118+ index : test
119+ body :
120+ track_total_hits : false
121+ fields : [ "keyword" ]
122+ knn :
123+ field : vector
124+ query_vector : [ 0.0 ]
125+ k : 3
126+ num_candidates : 3
127+ query :
128+ term :
129+ text : term
130+ rank :
131+ rrf :
132+ window_size : 100
133+ rank_constant : 1
134+ size : 1
135+
136+ - match : { hits.hits.0._id: "1" }
137+ - match : { hits.hits.0.fields.keyword.0: "other" }
138+
103139---
104140" Simple rank with multiple bm25 sub searches " :
105141
You can’t perform that action at this time.
0 commit comments