Reverting previous commit

This commit is contained in:
Christoph Büscher 2015-06-11 19:23:48 +02:00
parent 2a468fdcd3
commit 82cb0e66b4
2 changed files with 9 additions and 13 deletions

View File

@ -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);
}

View File

@ -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());
// }
}