Merge pull request #22215 from masaruh/skip_empty_boost
Don't print empty indices_boost
This commit is contained in:
commit
7cfa6898bf
|
@ -1171,6 +1171,7 @@ public final class SearchSourceBuilder extends ToXContentToBytes implements Writ
|
||||||
builder.field(SLICE.getPreferredName(), sliceBuilder);
|
builder.field(SLICE.getPreferredName(), sliceBuilder);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!indexBoosts.isEmpty()) {
|
||||||
builder.startArray(INDICES_BOOST_FIELD.getPreferredName());
|
builder.startArray(INDICES_BOOST_FIELD.getPreferredName());
|
||||||
for (IndexBoost ib : indexBoosts) {
|
for (IndexBoost ib : indexBoosts) {
|
||||||
builder.startObject();
|
builder.startObject();
|
||||||
|
@ -1178,6 +1179,7 @@ public final class SearchSourceBuilder extends ToXContentToBytes implements Writ
|
||||||
builder.endObject();
|
builder.endObject();
|
||||||
}
|
}
|
||||||
builder.endArray();
|
builder.endArray();
|
||||||
|
}
|
||||||
|
|
||||||
if (aggregations != null) {
|
if (aggregations != null) {
|
||||||
builder.field(AGGREGATIONS_FIELD.getPreferredName(), aggregations);
|
builder.field(AGGREGATIONS_FIELD.getPreferredName(), aggregations);
|
||||||
|
|
Loading…
Reference in New Issue