File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
x-pack/plugin/rank-rrf/src/main/java/org/elasticsearch/xpack/rank/rrf Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -106,7 +106,7 @@ public final class RRFRetrieverBuilder extends CompoundRetrieverBuilder<RRFRetri
106106 return fields ;
107107 }, FIELDS_FIELD , ObjectParser .ValueType .STRING_ARRAY );
108108 PARSER .declareString (ConstructingObjectParser .optionalConstructorArg (), QUERY_FIELD );
109- PARSER .declareInt (ConstructingObjectParser .optionalConstructorArg (), RankBuilder . RANK_WINDOW_SIZE_FIELD );
109+ PARSER .declareInt (ConstructingObjectParser .optionalConstructorArg (), RANK_WINDOW_SIZE_FIELD );
110110 PARSER .declareInt (ConstructingObjectParser .optionalConstructorArg (), RANK_CONSTANT_FIELD );
111111 PARSER .declareFloatArray (ConstructingObjectParser .optionalConstructorArg (), WEIGHTS_FIELD );
112112 RetrieverBuilder .declareBaseParserFields (PARSER );
Original file line number Diff line number Diff line change 1717import org .elasticsearch .xcontent .XContentParser ;
1818
1919import java .io .IOException ;
20+ import java .util .Objects ;
2021
2122import static org .elasticsearch .xcontent .ConstructingObjectParser .constructorArg ;
2223import static org .elasticsearch .xcontent .ConstructingObjectParser .optionalConstructorArg ;
@@ -31,8 +32,7 @@ public class RRFRetrieverComponent implements ToXContentObject {
3132 final float weight ;
3233
3334 public RRFRetrieverComponent (RetrieverBuilder retrieverBuilder , Float weight ) {
34- assert retrieverBuilder != null ;
35- this .retriever = retrieverBuilder ;
35+ this .retriever = Objects .requireNonNull (retrieverBuilder , "retrieverBuilder must not be null" );
3636 this .weight = weight == null ? DEFAULT_WEIGHT : weight ;
3737 if (this .weight < 0 ) {
3838 throw new IllegalArgumentException ("[weight] must be non-negative, found [" + this .weight + "]" );
You can’t perform that action at this time.
0 commit comments