Skip to content

Commit 3a82a28

Browse files
committed
Empty weight shouldnt be serialised
1 parent fd30387 commit 3a82a28

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

x-pack/plugin/rank-rrf/src/main/java/org/elasticsearch/xpack/rank/rrf/RRFRetrieverBuilder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ public void doToXContent(XContentBuilder builder, Params params) throws IOExcept
335335

336336
builder.field(RANK_WINDOW_SIZE_FIELD.getPreferredName(), rankWindowSize);
337337
builder.field(RANK_CONSTANT_FIELD.getPreferredName(), rankConstant);
338-
if (fields == null && query == null) {
338+
if (weights.length > 0) {
339339
builder.startArray(WEIGHTS_FIELD.getPreferredName());
340340
for (float weight : weights) {
341341
builder.value(weight);

0 commit comments

Comments
 (0)