Reverting previous commit
This commit is contained in:
parent
2a468fdcd3
commit
82cb0e66b4
|
@ -304,10 +304,6 @@ public class RangeQueryBuilder extends MultiTermQueryBuilder<RangeQueryBuilder>
|
|||
}
|
||||
|
||||
if (query == null) {
|
||||
if (this.timeZone != null) {
|
||||
throw new QueryParsingException(parseContext, "[range] time_zone can not be applied to non date field ["
|
||||
+ fieldName + "]");
|
||||
}
|
||||
query = new TermRangeQuery(this.fieldName, BytesRefs.toBytesRef(from), BytesRefs.toBytesRef(to), includeLower, includeUpper);
|
||||
}
|
||||
|
||||
|
|
|
@ -145,13 +145,13 @@ public class RangeQueryBuilderTest extends BaseQueryTestCase<RangeQueryBuilder>
|
|||
assertThat(rangeQueryBuilder.validate().validationErrors().size(), is(2));
|
||||
}
|
||||
|
||||
/**
|
||||
* Specifying a timezone together with a numeric range query should throw an error.
|
||||
*/
|
||||
@Test(expected=QueryParsingException.class)
|
||||
public void testToQueryNonDateWithTimezone() throws QueryParsingException, IOException {
|
||||
RangeQueryBuilder query = new RangeQueryBuilder(INT_FIELD_NAME);
|
||||
query.from(1).to(10).timeZone("UTC");
|
||||
query.toQuery(createContext());
|
||||
}
|
||||
// /**
|
||||
// * Specifying a timezone together with a numeric range query should throw an error.
|
||||
// */
|
||||
// @Test(expected=QueryParsingException.class)
|
||||
// public void testToQueryNonDateWithTimezone() throws QueryParsingException, IOException {
|
||||
// RangeQueryBuilder query = new RangeQueryBuilder(INT_FIELD_NAME);
|
||||
// query.from(1).to(10).timeZone("UTC");
|
||||
// query.toQuery(createContext());
|
||||
// }
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue