scoreFunctions.get(0).toXContent(builder, params);
} else { // in all other cases we build the format needed for a
builder.startArray("functions");
for (int i = 0; i < filters.size(); i++) {
builder.startObject();
<BUG>builder.field("filter");
filters.get(i).toXContent(builder, params);
scoreFunctions.get(i).toXContent(builder, params);</BUG>
builder.endObject();
}

scoreFunctions.get(0).toXContent(builder, params);
} else { // in all other cases we build the format needed for a
builder.startArray("functions");
for (int i = 0; i < filters.size(); i++) {
builder.startObject();
builder.field("filter");
if (filters.get(i) == null) {
FilterBuilders.matchAllFilter().toXContent(builder, params);
} else {
filters.get(i).toXContent(builder, params);
}
scoreFunctions.get(i).toXContent(builder, params);
builder.endObject();
}
