builder.field("unit", unit);
builder.field("distance_type", geoDistance.name().toLowerCase(Locale.ROOT));
if (order == SortOrder.DESC) {</BUG>
builder.field("reverse", true);
<BUG>} else {
builder.field("reverse", false);</BUG>
}
if (sortMode != null) {
builder.field("mode", sortMode);
}

builder.field("unit", unit);
}
if (geoDistance != null) {
builder.field("distance_type", geoDistance.name().toLowerCase(Locale.ROOT));
}
if (order == SortOrder.DESC) {
builder.field("reverse", true);
}
if (sortMode != null) {
builder.field("mode", sortMode);
}
