Skip to content

Commit

Permalink
drop fancy closures. one more
Browse files Browse the repository at this point in the history
Signed-off-by: mikhail-khludnev <[email protected]>
  • Loading branch information
mkhludnev authored and mikhail-khludnev committed Nov 13, 2024
1 parent 43803dc commit 605a639
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions server/src/main/java/org/opensearch/index/mapper/IpFieldMapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -246,22 +246,24 @@ public Query termQuery(Object value, @Nullable QueryShardContext context) {
}
pointQuery = (PointRangeQuery) query;
}
final Supplier<Query> dvQuery = () -> SortedSetDocValuesField.newSlowRangeQuery(
name(),
new BytesRef(pointQuery.getLowerPoint()),
new BytesRef(pointQuery.getUpperPoint()),
true,
true
);
Query dvQuery = null;
if (hasDocValues()) {
dvQuery = SortedSetDocValuesField.newSlowRangeQuery(
name(),
new BytesRef(pointQuery.getLowerPoint()),
new BytesRef(pointQuery.getUpperPoint()),
true,
true
);
}

if (isSearchable() && hasDocValues()) {
return new IndexOrDocValuesQuery(pointQuery, dvQuery.get());
return new IndexOrDocValuesQuery(pointQuery, dvQuery);
} else {
if (isSearchable()) {
return pointQuery;
} else {
assert hasDocValues();
return dvQuery.get();
return dvQuery;
}
}
}
Expand Down

0 comments on commit 605a639

Please sign in to comment.