Skip to content

Commit

Permalink
Fix formatting
Browse files Browse the repository at this point in the history
Signed-off-by: Harsha Vamsi Kalluri <[email protected]>
  • Loading branch information
harshavamsi committed Nov 30, 2023
1 parent 69c13f5 commit 0215078
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,12 @@ public Query termsQuery(List<?> values, QueryShardContext context) {
long scaledValue = Math.round(scale(value));
scaledValues.add(scaledValue);
}
Query query = NumberFieldMapper.NumberType.LONG.termsQuery(name(),
Collections.unmodifiableList(scaledValues), hasDocValues(), isSearchable());
Query query = NumberFieldMapper.NumberType.LONG.termsQuery(
name(),
Collections.unmodifiableList(scaledValues),
hasDocValues(),
isSearchable()
);
if (boost() != 1f) {
query = new BoostQuery(query, boost());
}
Expand All @@ -243,8 +247,7 @@ public Query rangeQuery(Object lowerTerm, Object upperTerm, boolean includeLower
}
hi = Math.round(Math.floor(dValue));
}
Query query = NumberFieldMapper.NumberType.LONG.rangeQuery(name(), lo, hi, true, true, hasDocValues(),
isSearchable(), context);
Query query = NumberFieldMapper.NumberType.LONG.rangeQuery(name(), lo, hi, true, true, hasDocValues(), isSearchable(), context);
if (boost() != 1f) {
query = new BoostQuery(query, boost());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,16 @@ public void testRangeQuery() throws IOException {
Double u = randomBoolean() ? null : (randomDouble() * 2 - 1) * 10000;
boolean includeLower = randomBoolean();
boolean includeUpper = randomBoolean();
Query doubleQ = NumberFieldMapper.NumberType.DOUBLE.rangeQuery("double", l, u, includeLower, includeUpper
, false, true, MOCK_QSC);
Query doubleQ = NumberFieldMapper.NumberType.DOUBLE.rangeQuery(
"double",
l,
u,
includeLower,
includeUpper,
false,
true,
MOCK_QSC
);
Query scaledFloatQ = ft.rangeQuery(l, u, includeLower, includeUpper, MOCK_QSC);
assertEquals(searcher.count(doubleQ), searcher.count(scaledFloatQ));
}
Expand Down

0 comments on commit 0215078

Please sign in to comment.