[TEST] fix lucene query comparison in RangeQueryBuilderTest
The expected query needs to use BytesRef to represent the from and to, otherwise we try to compare BytesRef with String and that returns false.
This commit is contained in:
parent
912e2ee69e
commit
88e3d6c4bc
|
@ -100,7 +100,7 @@ public class RangeQueryBuilderTest extends BaseQueryTestCase<RangeQueryBuilder>
|
|||
dateTimeZone = DateTimeZone.forID(queryBuilder.timeZone());
|
||||
}
|
||||
MappedFieldType mapper = context.fieldMapper(queryBuilder.fieldName());
|
||||
expectedQuery = ((DateFieldMapper.DateFieldType) mapper).rangeQuery(queryBuilder.from(), queryBuilder.to(),
|
||||
expectedQuery = ((DateFieldMapper.DateFieldType) mapper).rangeQuery(BytesRefs.toBytesRef(queryBuilder.from()), BytesRefs.toBytesRef(queryBuilder.to()),
|
||||
queryBuilder.includeLower(), queryBuilder.includeUpper(), dateTimeZone, forcedDateParser, context);
|
||||
} else if (queryBuilder.fieldName().equals(INT_FIELD_NAME)) {
|
||||
expectedQuery = NumericRangeQuery.newIntRange(INT_FIELD_NAME, (Integer) queryBuilder.from(), (Integer) queryBuilder.to(),
|
||||
|
|
Loading…
Reference in New Issue