From 82cb0e66b4ee8cea00e471dd97ccdfbff98da59c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20B=C3=BCscher?= Date: Thu, 11 Jun 2015 19:23:48 +0200 Subject: [PATCH] Reverting previous commit --- .../index/query/RangeQueryBuilder.java | 4 ---- .../index/query/RangeQueryBuilderTest.java | 18 +++++++++--------- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/core/src/main/java/org/elasticsearch/index/query/RangeQueryBuilder.java b/core/src/main/java/org/elasticsearch/index/query/RangeQueryBuilder.java index 4cb87df7bb6..548b233dbfe 100644 --- a/core/src/main/java/org/elasticsearch/index/query/RangeQueryBuilder.java +++ b/core/src/main/java/org/elasticsearch/index/query/RangeQueryBuilder.java @@ -304,10 +304,6 @@ public class RangeQueryBuilder extends MultiTermQueryBuilder } 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); } diff --git a/core/src/test/java/org/elasticsearch/index/query/RangeQueryBuilderTest.java b/core/src/test/java/org/elasticsearch/index/query/RangeQueryBuilderTest.java index e236bc83259..0cb29817d39 100644 --- a/core/src/test/java/org/elasticsearch/index/query/RangeQueryBuilderTest.java +++ b/core/src/test/java/org/elasticsearch/index/query/RangeQueryBuilderTest.java @@ -145,13 +145,13 @@ public class RangeQueryBuilderTest extends BaseQueryTestCase 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()); +// } }