From 0dbffbebcc55efb9797c4b08884b55423467d917 Mon Sep 17 00:00:00 2001 From: javanna Date: Thu, 7 May 2015 14:58:38 +0200 Subject: [PATCH] Revert "Filter refactoring: Introduce toFilter() and fromXContent() in FilterBuilders and FilterParsers" This reverts commit 580ef6f855a761eb5594856fe7719d51375ddb0f given that FilterBuilder and FilterParser are going away with #10985 Conflicts: src/main/java/org/elasticsearch/index/query/BaseFilterBuilder.java src/main/java/org/elasticsearch/index/query/BaseFilterParser.java src/main/java/org/elasticsearch/index/query/BaseFilterParserTemp.java src/main/java/org/elasticsearch/index/query/FilterWrappingFilterBuilder.java --- .../index/query/AndFilterBuilder.java | 5 -- .../index/query/AndFilterParser.java | 2 +- .../index/query/BaseFilterBuilder.java | 20 +------ .../index/query/BaseFilterParser.java | 39 ------------- .../index/query/BaseFilterParserTemp.java | 39 ------------- .../index/query/BoolFilterBuilder.java | 5 -- .../index/query/BoolFilterParser.java | 2 +- .../index/query/BytesFilterBuilder.java | 6 -- .../index/query/ExistsFilterBuilder.java | 5 -- .../index/query/ExistsFilterParser.java | 2 +- .../index/query/FQueryFilterParser.java | 2 +- .../index/query/FilterBuilder.java | 14 ++--- .../index/query/FilterParser.java | 14 ----- .../query/FilterWrappingFilterBuilder.java | 55 ------------------- .../query/GeoBoundingBoxFilterBuilder.java | 5 -- .../query/GeoBoundingBoxFilterParser.java | 2 +- .../index/query/GeoDistanceFilterBuilder.java | 5 -- .../index/query/GeoDistanceFilterParser.java | 2 +- .../query/GeoDistanceRangeFilterBuilder.java | 5 -- .../query/GeoDistanceRangeFilterParser.java | 2 +- .../index/query/GeoPolygonFilterBuilder.java | 5 -- .../index/query/GeoPolygonFilterParser.java | 2 +- .../index/query/GeoShapeFilterBuilder.java | 5 -- .../index/query/GeoShapeFilterParser.java | 2 +- .../index/query/GeohashCellFilter.java | 7 +-- .../index/query/HasChildFilterBuilder.java | 5 -- .../index/query/HasChildFilterParser.java | 2 +- .../index/query/HasParentFilterBuilder.java | 5 -- .../index/query/HasParentFilterParser.java | 2 +- .../index/query/IdsFilterBuilder.java | 5 -- .../index/query/IdsFilterParser.java | 2 +- .../index/query/IndicesFilterBuilder.java | 5 -- .../index/query/IndicesFilterParser.java | 2 +- .../index/query/LimitFilterBuilder.java | 5 -- .../index/query/LimitFilterParser.java | 2 +- .../index/query/MatchAllFilterBuilder.java | 5 -- .../index/query/MatchAllFilterParser.java | 2 +- .../index/query/MissingFilterBuilder.java | 5 -- .../index/query/MissingFilterParser.java | 2 +- .../index/query/NestedFilterBuilder.java | 5 -- .../index/query/NestedFilterParser.java | 2 +- .../index/query/NotFilterBuilder.java | 5 -- .../index/query/NotFilterParser.java | 2 +- .../index/query/OrFilterBuilder.java | 5 -- .../index/query/OrFilterParser.java | 2 +- .../index/query/PrefixFilterBuilder.java | 5 -- .../index/query/PrefixFilterParser.java | 2 +- .../index/query/QueryFilterBuilder.java | 5 -- .../index/query/QueryFilterParser.java | 2 +- .../index/query/RangeFilterBuilder.java | 5 -- .../index/query/RangeFilterParser.java | 2 +- .../index/query/RegexpFilterBuilder.java | 5 -- .../index/query/RegexpFilterParser.java | 2 +- .../index/query/ScriptFilterBuilder.java | 5 -- .../index/query/ScriptFilterParser.java | 2 +- .../index/query/TermFilterBuilder.java | 5 -- .../index/query/TermFilterParser.java | 2 +- .../index/query/TermsFilterBuilder.java | 5 -- .../index/query/TermsFilterParser.java | 2 +- .../index/query/TermsLookupFilterBuilder.java | 7 +-- .../index/query/TypeFilterBuilder.java | 5 -- .../index/query/TypeFilterParser.java | 2 +- .../index/query/WrapperFilterBuilder.java | 5 -- .../index/query/WrapperFilterParser.java | 2 +- .../index/query/guice/MyJsonFilterParser.java | 10 +--- .../query/plugin/PluginJsonFilterParser.java | 10 +--- 66 files changed, 43 insertions(+), 369 deletions(-) delete mode 100644 src/main/java/org/elasticsearch/index/query/BaseFilterParser.java delete mode 100644 src/main/java/org/elasticsearch/index/query/BaseFilterParserTemp.java delete mode 100644 src/main/java/org/elasticsearch/index/query/FilterWrappingFilterBuilder.java diff --git a/src/main/java/org/elasticsearch/index/query/AndFilterBuilder.java b/src/main/java/org/elasticsearch/index/query/AndFilterBuilder.java index 4f3ad5cefbef9..87611a03b734f 100644 --- a/src/main/java/org/elasticsearch/index/query/AndFilterBuilder.java +++ b/src/main/java/org/elasticsearch/index/query/AndFilterBuilder.java @@ -71,9 +71,4 @@ protected void doXContent(XContentBuilder builder, Params params) throws IOExcep } builder.endObject(); } - - @Override - protected String parserName() { - return AndFilterParser.NAME; - } } \ No newline at end of file diff --git a/src/main/java/org/elasticsearch/index/query/AndFilterParser.java b/src/main/java/org/elasticsearch/index/query/AndFilterParser.java index 640fc45bce57a..f0c8c2724bb72 100644 --- a/src/main/java/org/elasticsearch/index/query/AndFilterParser.java +++ b/src/main/java/org/elasticsearch/index/query/AndFilterParser.java @@ -34,7 +34,7 @@ /** * */ -public class AndFilterParser extends BaseFilterParserTemp { +public class AndFilterParser implements FilterParser { public static final String NAME = "and"; diff --git a/src/main/java/org/elasticsearch/index/query/BaseFilterBuilder.java b/src/main/java/org/elasticsearch/index/query/BaseFilterBuilder.java index 8bfce92c98e6d..69264fb4b45a5 100644 --- a/src/main/java/org/elasticsearch/index/query/BaseFilterBuilder.java +++ b/src/main/java/org/elasticsearch/index/query/BaseFilterBuilder.java @@ -19,7 +19,6 @@ package org.elasticsearch.index.query; -import org.apache.lucene.search.Filter; import org.elasticsearch.ElasticsearchException; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.xcontent.XContentBuilder; @@ -28,6 +27,9 @@ import java.io.IOException; +/** + * + */ public abstract class BaseFilterBuilder implements FilterBuilder { @Override @@ -67,20 +69,4 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws } protected abstract void doXContent(XContentBuilder builder, Params params) throws IOException; - - /** - * Temporary default implementation for toFilter that parses the filter using its filter parser - */ - //norelease to be removed once all filter builders override toFilter providing their own specific implementation. - @Override - public Filter toFilter(QueryParseContext parseContext) throws IOException { - return parseContext.indexQueryParserService().filterParser(parserName()).parse(parseContext); - } - - /** - * Temporary method that allows to retrieve the parser for each filter. - * @return the name of the parser class the default {@link #toFilter(QueryParseContext)} method delegates to - */ - //norelease to be removed once all filter builders override toFilter providing their own specific implementation. - protected abstract String parserName(); } diff --git a/src/main/java/org/elasticsearch/index/query/BaseFilterParser.java b/src/main/java/org/elasticsearch/index/query/BaseFilterParser.java deleted file mode 100644 index 069d93c268dc0..0000000000000 --- a/src/main/java/org/elasticsearch/index/query/BaseFilterParser.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Licensed to Elasticsearch under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.elasticsearch.index.query; - -import org.apache.lucene.search.Filter; - -import java.io.IOException; - -/** - * Class used during the filter parsers refactoring. Will be removed once we can parse search requests on the coordinating node. - * All filter parsers that have a refactored "fromXContent" method can be changed to extend this instead of {@link BaseFilterParserTemp}. - * Keeps old {@link FilterParser#parse(QueryParseContext)} method as a stub delegating to - * {@link FilterParser#fromXContent(QueryParseContext)} and {@link FilterBuilder#toFilter(QueryParseContext)}} - */ -//norelease needs to be removed once we parse search requests on the coordinating node, as the parse method is not needed anymore at that point. -public abstract class BaseFilterParser implements FilterParser { - - @Override - public final Filter parse(QueryParseContext parseContext) throws IOException, QueryParsingException { - return fromXContent(parseContext).toFilter(parseContext); - } -} diff --git a/src/main/java/org/elasticsearch/index/query/BaseFilterParserTemp.java b/src/main/java/org/elasticsearch/index/query/BaseFilterParserTemp.java deleted file mode 100644 index 7b68c19a8f179..0000000000000 --- a/src/main/java/org/elasticsearch/index/query/BaseFilterParserTemp.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Licensed to Elasticsearch under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.elasticsearch.index.query; - -import org.apache.lucene.search.Filter; - -import java.io.IOException; - -/** - * This class with method impl is an intermediate step in the filter parsers refactoring. - * Provides a fromXContent default implementation for filter parsers that don't have yet a - * specific fromXContent implementation that returns a FilterBuilder. - */ -//norelease to be removed once all filters are moved over to extend BaseFilterParser -public abstract class BaseFilterParserTemp implements FilterParser { - - @Override - public FilterBuilder fromXContent(QueryParseContext parseContext) throws IOException, QueryParsingException { - Filter filter = parse(parseContext); - return new FilterWrappingFilterBuilder(filter); - } -} diff --git a/src/main/java/org/elasticsearch/index/query/BoolFilterBuilder.java b/src/main/java/org/elasticsearch/index/query/BoolFilterBuilder.java index 52689698406a6..330adaf8d089b 100644 --- a/src/main/java/org/elasticsearch/index/query/BoolFilterBuilder.java +++ b/src/main/java/org/elasticsearch/index/query/BoolFilterBuilder.java @@ -139,9 +139,4 @@ private void doXArrayContent(String field, List clauses, XContent builder.endArray(); } } - - @Override - protected String parserName() { - return BoolFilterParser.NAME; - } } \ No newline at end of file diff --git a/src/main/java/org/elasticsearch/index/query/BoolFilterParser.java b/src/main/java/org/elasticsearch/index/query/BoolFilterParser.java index f590e1bf8209c..7d96f1bc3bc60 100644 --- a/src/main/java/org/elasticsearch/index/query/BoolFilterParser.java +++ b/src/main/java/org/elasticsearch/index/query/BoolFilterParser.java @@ -31,7 +31,7 @@ /** * */ -public class BoolFilterParser extends BaseFilterParserTemp { +public class BoolFilterParser implements FilterParser { public static final String NAME = "bool"; diff --git a/src/main/java/org/elasticsearch/index/query/BytesFilterBuilder.java b/src/main/java/org/elasticsearch/index/query/BytesFilterBuilder.java index 03eabd31a7f74..a86ea239f70ca 100644 --- a/src/main/java/org/elasticsearch/index/query/BytesFilterBuilder.java +++ b/src/main/java/org/elasticsearch/index/query/BytesFilterBuilder.java @@ -46,10 +46,4 @@ protected void doXContent(XContentBuilder builder, Params params) throws IOExcep builder.copyCurrentStructure(parser); } } - - @Override - protected String parserName() { - //TODO this class is going to be removed, will disappear once we get #10919 in - throw new UnsupportedOperationException(); - } } diff --git a/src/main/java/org/elasticsearch/index/query/ExistsFilterBuilder.java b/src/main/java/org/elasticsearch/index/query/ExistsFilterBuilder.java index ea8c64a33dd57..56511c4223b30 100644 --- a/src/main/java/org/elasticsearch/index/query/ExistsFilterBuilder.java +++ b/src/main/java/org/elasticsearch/index/query/ExistsFilterBuilder.java @@ -56,9 +56,4 @@ protected void doXContent(XContentBuilder builder, Params params) throws IOExcep } builder.endObject(); } - - @Override - protected String parserName() { - return ExistsFilterParser.NAME; - } } diff --git a/src/main/java/org/elasticsearch/index/query/ExistsFilterParser.java b/src/main/java/org/elasticsearch/index/query/ExistsFilterParser.java index 427ae1e6bf567..8dc0a3eb2c18f 100644 --- a/src/main/java/org/elasticsearch/index/query/ExistsFilterParser.java +++ b/src/main/java/org/elasticsearch/index/query/ExistsFilterParser.java @@ -39,7 +39,7 @@ /** * */ -public class ExistsFilterParser extends BaseFilterParserTemp { +public class ExistsFilterParser implements FilterParser { public static final String NAME = "exists"; diff --git a/src/main/java/org/elasticsearch/index/query/FQueryFilterParser.java b/src/main/java/org/elasticsearch/index/query/FQueryFilterParser.java index b2149a5826970..b349dd3e65c57 100644 --- a/src/main/java/org/elasticsearch/index/query/FQueryFilterParser.java +++ b/src/main/java/org/elasticsearch/index/query/FQueryFilterParser.java @@ -31,7 +31,7 @@ * The "fquery" filter is the same as the {@link QueryFilterParser} except that it allows also to * associate a name with the query filter. */ -public class FQueryFilterParser extends BaseFilterParserTemp { +public class FQueryFilterParser implements FilterParser { public static final String NAME = "fquery"; diff --git a/src/main/java/org/elasticsearch/index/query/FilterBuilder.java b/src/main/java/org/elasticsearch/index/query/FilterBuilder.java index 30f5a10488ec9..9b3a89976c50c 100644 --- a/src/main/java/org/elasticsearch/index/query/FilterBuilder.java +++ b/src/main/java/org/elasticsearch/index/query/FilterBuilder.java @@ -19,24 +19,18 @@ package org.elasticsearch.index.query; -import org.apache.lucene.search.Filter; +import org.elasticsearch.ElasticsearchException; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.xcontent.ToXContent; import org.elasticsearch.common.xcontent.XContentType; -import java.io.IOException; - +/** + * + */ public interface FilterBuilder extends ToXContent { BytesReference buildAsBytes(); BytesReference buildAsBytes(XContentType contentType); - /** - * Converts this FilterBuilder to a lucene {@link Filter} - * @param parseContext additional information needed to construct the filter - * @return the {@link Filter} - * @throws IOException - */ - Filter toFilter(QueryParseContext parseContext) throws IOException; } diff --git a/src/main/java/org/elasticsearch/index/query/FilterParser.java b/src/main/java/org/elasticsearch/index/query/FilterParser.java index ebd202bd1499f..94d4fbfe9b580 100644 --- a/src/main/java/org/elasticsearch/index/query/FilterParser.java +++ b/src/main/java/org/elasticsearch/index/query/FilterParser.java @@ -43,18 +43,4 @@ public interface FilterParser { //norelease can be removed in favour of fromXContent once search requests can be parsed on the coordinating node @Nullable Filter parse(QueryParseContext parseContext) throws IOException, QueryParsingException; - - /** - * Creates a new {@link FilterBuilder} from the filter held by the {@link QueryParseContext} - * in {@link org.elasticsearch.common.xcontent.XContent} format - * - * @param parseContext - * the input parse context. The state on the parser contained in - * this context will be changed as a side effect of this method - * call - * @return the new FilterBuilder - * @throws IOException - * @throws QueryParsingException - */ - FilterBuilder fromXContent(QueryParseContext parseContext) throws IOException, QueryParsingException; } \ No newline at end of file diff --git a/src/main/java/org/elasticsearch/index/query/FilterWrappingFilterBuilder.java b/src/main/java/org/elasticsearch/index/query/FilterWrappingFilterBuilder.java deleted file mode 100644 index 78cdfc08e0c63..0000000000000 --- a/src/main/java/org/elasticsearch/index/query/FilterWrappingFilterBuilder.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Licensed to Elasticsearch under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.elasticsearch.index.query; - -import org.apache.lucene.search.Filter; -import org.elasticsearch.common.xcontent.XContentBuilder; - -import java.io.IOException; - -/** - * FilterBuilder implementation that holds a lucene filter, which can be returned by {@link #toFilter(QueryParseContext)}. - * Doesn't support conversion to {@link org.elasticsearch.common.xcontent.XContent} via {@link #doXContent(XContentBuilder, Params)}. - */ -//norelease to be removed once all queries support separate fromXContent and toQuery methods -public class FilterWrappingFilterBuilder extends BaseFilterBuilder { - - private final Filter filter; - - public FilterWrappingFilterBuilder(Filter filter) { - this.filter = filter; - } - - @Override - protected void doXContent(XContentBuilder builder, Params params) throws IOException { - throw new UnsupportedOperationException(); - } - - @Override - public Filter toFilter(QueryParseContext parseContext) throws IOException { - return this.filter; - } - - @Override - protected String parserName() { - // this should not be called since we overwrite BaseFilterBuilder#toFilter() in this class - throw new UnsupportedOperationException(); - } -} diff --git a/src/main/java/org/elasticsearch/index/query/GeoBoundingBoxFilterBuilder.java b/src/main/java/org/elasticsearch/index/query/GeoBoundingBoxFilterBuilder.java index 485e4613540bf..40b41c7ffbdc2 100644 --- a/src/main/java/org/elasticsearch/index/query/GeoBoundingBoxFilterBuilder.java +++ b/src/main/java/org/elasticsearch/index/query/GeoBoundingBoxFilterBuilder.java @@ -175,9 +175,4 @@ protected void doXContent(XContentBuilder builder, Params params) throws IOExcep builder.endObject(); } - - @Override - protected String parserName() { - return GeoBoundingBoxFilterParser.NAME; - } } diff --git a/src/main/java/org/elasticsearch/index/query/GeoBoundingBoxFilterParser.java b/src/main/java/org/elasticsearch/index/query/GeoBoundingBoxFilterParser.java index f070014eae213..6441b8d4b07f2 100644 --- a/src/main/java/org/elasticsearch/index/query/GeoBoundingBoxFilterParser.java +++ b/src/main/java/org/elasticsearch/index/query/GeoBoundingBoxFilterParser.java @@ -37,7 +37,7 @@ /** * */ -public class GeoBoundingBoxFilterParser extends BaseFilterParserTemp { +public class GeoBoundingBoxFilterParser implements FilterParser { public static final String TOP = "top"; public static final String LEFT = "left"; diff --git a/src/main/java/org/elasticsearch/index/query/GeoDistanceFilterBuilder.java b/src/main/java/org/elasticsearch/index/query/GeoDistanceFilterBuilder.java index 303b71496e5dd..a45aee92c6ced 100644 --- a/src/main/java/org/elasticsearch/index/query/GeoDistanceFilterBuilder.java +++ b/src/main/java/org/elasticsearch/index/query/GeoDistanceFilterBuilder.java @@ -120,9 +120,4 @@ protected void doXContent(XContentBuilder builder, Params params) throws IOExcep } builder.endObject(); } - - @Override - protected String parserName() { - return GeoDistanceFilterParser.NAME; - } } diff --git a/src/main/java/org/elasticsearch/index/query/GeoDistanceFilterParser.java b/src/main/java/org/elasticsearch/index/query/GeoDistanceFilterParser.java index bd8fec1cfba7f..ff46d591f3cf0 100644 --- a/src/main/java/org/elasticsearch/index/query/GeoDistanceFilterParser.java +++ b/src/main/java/org/elasticsearch/index/query/GeoDistanceFilterParser.java @@ -43,7 +43,7 @@ * } * */ -public class GeoDistanceFilterParser extends BaseFilterParserTemp { +public class GeoDistanceFilterParser implements FilterParser { public static final String NAME = "geo_distance"; diff --git a/src/main/java/org/elasticsearch/index/query/GeoDistanceRangeFilterBuilder.java b/src/main/java/org/elasticsearch/index/query/GeoDistanceRangeFilterBuilder.java index d402dba1b1e73..c21cd3d62d796 100644 --- a/src/main/java/org/elasticsearch/index/query/GeoDistanceRangeFilterBuilder.java +++ b/src/main/java/org/elasticsearch/index/query/GeoDistanceRangeFilterBuilder.java @@ -159,9 +159,4 @@ protected void doXContent(XContentBuilder builder, Params params) throws IOExcep } builder.endObject(); } - - @Override - protected String parserName() { - return GeoDistanceRangeFilterParser.NAME; - } } diff --git a/src/main/java/org/elasticsearch/index/query/GeoDistanceRangeFilterParser.java b/src/main/java/org/elasticsearch/index/query/GeoDistanceRangeFilterParser.java index 7bbf133926708..9322a230c0197 100644 --- a/src/main/java/org/elasticsearch/index/query/GeoDistanceRangeFilterParser.java +++ b/src/main/java/org/elasticsearch/index/query/GeoDistanceRangeFilterParser.java @@ -43,7 +43,7 @@ * } * */ -public class GeoDistanceRangeFilterParser extends BaseFilterParserTemp { +public class GeoDistanceRangeFilterParser implements FilterParser { public static final String NAME = "geo_distance_range"; diff --git a/src/main/java/org/elasticsearch/index/query/GeoPolygonFilterBuilder.java b/src/main/java/org/elasticsearch/index/query/GeoPolygonFilterBuilder.java index 2714d26fbfa28..fd0a2f569c440 100644 --- a/src/main/java/org/elasticsearch/index/query/GeoPolygonFilterBuilder.java +++ b/src/main/java/org/elasticsearch/index/query/GeoPolygonFilterBuilder.java @@ -91,9 +91,4 @@ protected void doXContent(XContentBuilder builder, Params params) throws IOExcep builder.endObject(); } - - @Override - protected String parserName() { - return GeoPolygonFilterParser.NAME; - } } diff --git a/src/main/java/org/elasticsearch/index/query/GeoPolygonFilterParser.java b/src/main/java/org/elasticsearch/index/query/GeoPolygonFilterParser.java index f4658996dc5ac..f3f41ac71265c 100644 --- a/src/main/java/org/elasticsearch/index/query/GeoPolygonFilterParser.java +++ b/src/main/java/org/elasticsearch/index/query/GeoPolygonFilterParser.java @@ -48,7 +48,7 @@ * } * */ -public class GeoPolygonFilterParser extends BaseFilterParserTemp { +public class GeoPolygonFilterParser implements FilterParser { public static final String NAME = "geo_polygon"; public static final String POINTS = "points"; diff --git a/src/main/java/org/elasticsearch/index/query/GeoShapeFilterBuilder.java b/src/main/java/org/elasticsearch/index/query/GeoShapeFilterBuilder.java index 40a898351fd8a..1ac7b14481cba 100644 --- a/src/main/java/org/elasticsearch/index/query/GeoShapeFilterBuilder.java +++ b/src/main/java/org/elasticsearch/index/query/GeoShapeFilterBuilder.java @@ -183,9 +183,4 @@ protected void doXContent(XContentBuilder builder, Params params) throws IOExcep builder.endObject(); } - - @Override - protected String parserName() { - return GeoShapeFilterParser.NAME; - } } diff --git a/src/main/java/org/elasticsearch/index/query/GeoShapeFilterParser.java b/src/main/java/org/elasticsearch/index/query/GeoShapeFilterParser.java index 418ffaf93efa2..bba22882d2783 100644 --- a/src/main/java/org/elasticsearch/index/query/GeoShapeFilterParser.java +++ b/src/main/java/org/elasticsearch/index/query/GeoShapeFilterParser.java @@ -59,7 +59,7 @@ * } * */ -public class GeoShapeFilterParser extends BaseFilterParserTemp { +public class GeoShapeFilterParser implements FilterParser { public static final String NAME = "geo_shape"; diff --git a/src/main/java/org/elasticsearch/index/query/GeohashCellFilter.java b/src/main/java/org/elasticsearch/index/query/GeohashCellFilter.java index f6b866c18939c..e390bf53ea744 100644 --- a/src/main/java/org/elasticsearch/index/query/GeohashCellFilter.java +++ b/src/main/java/org/elasticsearch/index/query/GeohashCellFilter.java @@ -168,14 +168,9 @@ protected void doXContent(XContentBuilder builder, Params params) throws IOExcep builder.endObject(); } - - @Override - protected String parserName() { - return NAME; - } } - public static class Parser extends BaseFilterParserTemp { + public static class Parser implements FilterParser { @Inject public Parser() { diff --git a/src/main/java/org/elasticsearch/index/query/HasChildFilterBuilder.java b/src/main/java/org/elasticsearch/index/query/HasChildFilterBuilder.java index 75ae96dad4aef..365d30b4e2937 100644 --- a/src/main/java/org/elasticsearch/index/query/HasChildFilterBuilder.java +++ b/src/main/java/org/elasticsearch/index/query/HasChildFilterBuilder.java @@ -135,10 +135,5 @@ protected void doXContent(XContentBuilder builder, Params params) throws IOExcep } builder.endObject(); } - - @Override - protected String parserName() { - return HasChildFilterParser.NAME; - } } diff --git a/src/main/java/org/elasticsearch/index/query/HasChildFilterParser.java b/src/main/java/org/elasticsearch/index/query/HasChildFilterParser.java index f45e58853ad81..8bf761b84a0a0 100644 --- a/src/main/java/org/elasticsearch/index/query/HasChildFilterParser.java +++ b/src/main/java/org/elasticsearch/index/query/HasChildFilterParser.java @@ -44,7 +44,7 @@ /** * */ -public class HasChildFilterParser extends BaseFilterParserTemp { +public class HasChildFilterParser implements FilterParser { public static final String NAME = "has_child"; diff --git a/src/main/java/org/elasticsearch/index/query/HasParentFilterBuilder.java b/src/main/java/org/elasticsearch/index/query/HasParentFilterBuilder.java index 191c0292ca33f..8f565022c4fca 100644 --- a/src/main/java/org/elasticsearch/index/query/HasParentFilterBuilder.java +++ b/src/main/java/org/elasticsearch/index/query/HasParentFilterBuilder.java @@ -91,10 +91,5 @@ protected void doXContent(XContentBuilder builder, Params params) throws IOExcep } builder.endObject(); } - - @Override - protected String parserName() { - return HasParentFilterParser.NAME; - } } diff --git a/src/main/java/org/elasticsearch/index/query/HasParentFilterParser.java b/src/main/java/org/elasticsearch/index/query/HasParentFilterParser.java index c32903999b6dc..331f575df7760 100644 --- a/src/main/java/org/elasticsearch/index/query/HasParentFilterParser.java +++ b/src/main/java/org/elasticsearch/index/query/HasParentFilterParser.java @@ -36,7 +36,7 @@ /** * */ -public class HasParentFilterParser extends BaseFilterParserTemp { +public class HasParentFilterParser implements FilterParser { public static final String NAME = "has_parent"; diff --git a/src/main/java/org/elasticsearch/index/query/IdsFilterBuilder.java b/src/main/java/org/elasticsearch/index/query/IdsFilterBuilder.java index 1a633024708f3..0be091cdc4f59 100644 --- a/src/main/java/org/elasticsearch/index/query/IdsFilterBuilder.java +++ b/src/main/java/org/elasticsearch/index/query/IdsFilterBuilder.java @@ -93,9 +93,4 @@ public void doXContent(XContentBuilder builder, Params params) throws IOExceptio builder.endObject(); } - - @Override - protected String parserName() { - return IdsFilterParser.NAME; - } } \ No newline at end of file diff --git a/src/main/java/org/elasticsearch/index/query/IdsFilterParser.java b/src/main/java/org/elasticsearch/index/query/IdsFilterParser.java index 304a20136499d..23d4c9c148342 100644 --- a/src/main/java/org/elasticsearch/index/query/IdsFilterParser.java +++ b/src/main/java/org/elasticsearch/index/query/IdsFilterParser.java @@ -37,7 +37,7 @@ import java.util.Collection; import java.util.List; -public class IdsFilterParser extends BaseFilterParserTemp { +public class IdsFilterParser implements FilterParser { public static final String NAME = "ids"; diff --git a/src/main/java/org/elasticsearch/index/query/IndicesFilterBuilder.java b/src/main/java/org/elasticsearch/index/query/IndicesFilterBuilder.java index ba046a1673363..3ffed4504523e 100644 --- a/src/main/java/org/elasticsearch/index/query/IndicesFilterBuilder.java +++ b/src/main/java/org/elasticsearch/index/query/IndicesFilterBuilder.java @@ -86,9 +86,4 @@ protected void doXContent(XContentBuilder builder, Params params) throws IOExcep builder.endObject(); } - - @Override - protected String parserName() { - return IndicesFilterParser.NAME; - } } \ No newline at end of file diff --git a/src/main/java/org/elasticsearch/index/query/IndicesFilterParser.java b/src/main/java/org/elasticsearch/index/query/IndicesFilterParser.java index 13c2d899aa07e..7bd39dad9479f 100644 --- a/src/main/java/org/elasticsearch/index/query/IndicesFilterParser.java +++ b/src/main/java/org/elasticsearch/index/query/IndicesFilterParser.java @@ -34,7 +34,7 @@ /** */ -public class IndicesFilterParser extends BaseFilterParserTemp { +public class IndicesFilterParser implements FilterParser { public static final String NAME = "indices"; diff --git a/src/main/java/org/elasticsearch/index/query/LimitFilterBuilder.java b/src/main/java/org/elasticsearch/index/query/LimitFilterBuilder.java index db95fd2d787a9..552c47b6cf655 100644 --- a/src/main/java/org/elasticsearch/index/query/LimitFilterBuilder.java +++ b/src/main/java/org/elasticsearch/index/query/LimitFilterBuilder.java @@ -42,9 +42,4 @@ protected void doXContent(XContentBuilder builder, Params params) throws IOExcep builder.field("value", limit); builder.endObject(); } - - @Override - protected String parserName() { - return LimitFilterParser.NAME; - } } \ No newline at end of file diff --git a/src/main/java/org/elasticsearch/index/query/LimitFilterParser.java b/src/main/java/org/elasticsearch/index/query/LimitFilterParser.java index 359c9ced84b24..f4f8fde7427e6 100644 --- a/src/main/java/org/elasticsearch/index/query/LimitFilterParser.java +++ b/src/main/java/org/elasticsearch/index/query/LimitFilterParser.java @@ -26,7 +26,7 @@ import java.io.IOException; -public class LimitFilterParser extends BaseFilterParserTemp { +public class LimitFilterParser implements FilterParser { public static final String NAME = "limit"; diff --git a/src/main/java/org/elasticsearch/index/query/MatchAllFilterBuilder.java b/src/main/java/org/elasticsearch/index/query/MatchAllFilterBuilder.java index 0c83d0dc1e1a0..ebb4ffd9fd3a2 100644 --- a/src/main/java/org/elasticsearch/index/query/MatchAllFilterBuilder.java +++ b/src/main/java/org/elasticsearch/index/query/MatchAllFilterBuilder.java @@ -40,9 +40,4 @@ public MatchAllFilterBuilder() { protected void doXContent(XContentBuilder builder, Params params) throws IOException { builder.startObject(MatchAllFilterParser.NAME).endObject(); } - - @Override - protected String parserName() { - return MatchAllFilterParser.NAME; - } } diff --git a/src/main/java/org/elasticsearch/index/query/MatchAllFilterParser.java b/src/main/java/org/elasticsearch/index/query/MatchAllFilterParser.java index 5de378e3149fc..2d78edad685e9 100644 --- a/src/main/java/org/elasticsearch/index/query/MatchAllFilterParser.java +++ b/src/main/java/org/elasticsearch/index/query/MatchAllFilterParser.java @@ -30,7 +30,7 @@ /** * */ -public class MatchAllFilterParser extends BaseFilterParserTemp { +public class MatchAllFilterParser implements FilterParser { public static final String NAME = "match_all"; diff --git a/src/main/java/org/elasticsearch/index/query/MissingFilterBuilder.java b/src/main/java/org/elasticsearch/index/query/MissingFilterBuilder.java index e70e4bc62f672..68e2eba2626fa 100644 --- a/src/main/java/org/elasticsearch/index/query/MissingFilterBuilder.java +++ b/src/main/java/org/elasticsearch/index/query/MissingFilterBuilder.java @@ -81,9 +81,4 @@ protected void doXContent(XContentBuilder builder, Params params) throws IOExcep } builder.endObject(); } - - @Override - protected String parserName() { - return MissingFilterParser.NAME; - } } diff --git a/src/main/java/org/elasticsearch/index/query/MissingFilterParser.java b/src/main/java/org/elasticsearch/index/query/MissingFilterParser.java index 26d06fc1a435e..07af9717dc19d 100644 --- a/src/main/java/org/elasticsearch/index/query/MissingFilterParser.java +++ b/src/main/java/org/elasticsearch/index/query/MissingFilterParser.java @@ -39,7 +39,7 @@ /** * */ -public class MissingFilterParser extends BaseFilterParserTemp { +public class MissingFilterParser implements FilterParser { public static final String NAME = "missing"; public static final boolean DEFAULT_NULL_VALUE = false; diff --git a/src/main/java/org/elasticsearch/index/query/NestedFilterBuilder.java b/src/main/java/org/elasticsearch/index/query/NestedFilterBuilder.java index c811eeccf895d..c64c7ef327e50 100644 --- a/src/main/java/org/elasticsearch/index/query/NestedFilterBuilder.java +++ b/src/main/java/org/elasticsearch/index/query/NestedFilterBuilder.java @@ -93,9 +93,4 @@ protected void doXContent(XContentBuilder builder, Params params) throws IOExcep } builder.endObject(); } - - @Override - protected String parserName() { - return NestedFilterParser.NAME; - } } \ No newline at end of file diff --git a/src/main/java/org/elasticsearch/index/query/NestedFilterParser.java b/src/main/java/org/elasticsearch/index/query/NestedFilterParser.java index 44ec0a89cc69b..467705afca73b 100644 --- a/src/main/java/org/elasticsearch/index/query/NestedFilterParser.java +++ b/src/main/java/org/elasticsearch/index/query/NestedFilterParser.java @@ -30,7 +30,7 @@ import java.io.IOException; -public class NestedFilterParser extends BaseFilterParserTemp { +public class NestedFilterParser implements FilterParser { public static final String NAME = "nested"; diff --git a/src/main/java/org/elasticsearch/index/query/NotFilterBuilder.java b/src/main/java/org/elasticsearch/index/query/NotFilterBuilder.java index 338cfdb34c805..1c5ea06f077f3 100644 --- a/src/main/java/org/elasticsearch/index/query/NotFilterBuilder.java +++ b/src/main/java/org/elasticsearch/index/query/NotFilterBuilder.java @@ -53,9 +53,4 @@ protected void doXContent(XContentBuilder builder, Params params) throws IOExcep } builder.endObject(); } - - @Override - protected String parserName() { - return NotFilterParser.NAME; - } } \ No newline at end of file diff --git a/src/main/java/org/elasticsearch/index/query/NotFilterParser.java b/src/main/java/org/elasticsearch/index/query/NotFilterParser.java index 90c78b21e1630..7ebf0fe82dc08 100644 --- a/src/main/java/org/elasticsearch/index/query/NotFilterParser.java +++ b/src/main/java/org/elasticsearch/index/query/NotFilterParser.java @@ -30,7 +30,7 @@ /** * */ -public class NotFilterParser extends BaseFilterParserTemp { +public class NotFilterParser implements FilterParser { public static final String NAME = "not"; diff --git a/src/main/java/org/elasticsearch/index/query/OrFilterBuilder.java b/src/main/java/org/elasticsearch/index/query/OrFilterBuilder.java index b5f7d66d55489..2feca66fc56fb 100644 --- a/src/main/java/org/elasticsearch/index/query/OrFilterBuilder.java +++ b/src/main/java/org/elasticsearch/index/query/OrFilterBuilder.java @@ -68,9 +68,4 @@ protected void doXContent(XContentBuilder builder, Params params) throws IOExcep } builder.endObject(); } - - @Override - protected String parserName() { - return OrFilterParser.NAME; - } } \ No newline at end of file diff --git a/src/main/java/org/elasticsearch/index/query/OrFilterParser.java b/src/main/java/org/elasticsearch/index/query/OrFilterParser.java index 056491bc800cd..dae526563c60f 100644 --- a/src/main/java/org/elasticsearch/index/query/OrFilterParser.java +++ b/src/main/java/org/elasticsearch/index/query/OrFilterParser.java @@ -34,7 +34,7 @@ /** * */ -public class OrFilterParser extends BaseFilterParserTemp { +public class OrFilterParser implements FilterParser { public static final String NAME = "or"; diff --git a/src/main/java/org/elasticsearch/index/query/PrefixFilterBuilder.java b/src/main/java/org/elasticsearch/index/query/PrefixFilterBuilder.java index 4a4c7a203f490..d202fcc281fd7 100644 --- a/src/main/java/org/elasticsearch/index/query/PrefixFilterBuilder.java +++ b/src/main/java/org/elasticsearch/index/query/PrefixFilterBuilder.java @@ -66,9 +66,4 @@ public void doXContent(XContentBuilder builder, Params params) throws IOExceptio } builder.endObject(); } - - @Override - protected String parserName() { - return PrefixFilterParser.NAME; - } } \ No newline at end of file diff --git a/src/main/java/org/elasticsearch/index/query/PrefixFilterParser.java b/src/main/java/org/elasticsearch/index/query/PrefixFilterParser.java index 7a4f9472e1093..d1f291e460609 100644 --- a/src/main/java/org/elasticsearch/index/query/PrefixFilterParser.java +++ b/src/main/java/org/elasticsearch/index/query/PrefixFilterParser.java @@ -33,7 +33,7 @@ /** * */ -public class PrefixFilterParser extends BaseFilterParserTemp { +public class PrefixFilterParser implements FilterParser { public static final String NAME = "prefix"; diff --git a/src/main/java/org/elasticsearch/index/query/QueryFilterBuilder.java b/src/main/java/org/elasticsearch/index/query/QueryFilterBuilder.java index 818528b28123e..c4af2419b5ca5 100644 --- a/src/main/java/org/elasticsearch/index/query/QueryFilterBuilder.java +++ b/src/main/java/org/elasticsearch/index/query/QueryFilterBuilder.java @@ -66,9 +66,4 @@ protected void doXContent(XContentBuilder builder, Params params) throws IOExcep builder.endObject(); } } - - @Override - protected String parserName() { - return QueryFilterParser.NAME; - } } diff --git a/src/main/java/org/elasticsearch/index/query/QueryFilterParser.java b/src/main/java/org/elasticsearch/index/query/QueryFilterParser.java index 24f73f61f76d6..bdc09dbee78a1 100644 --- a/src/main/java/org/elasticsearch/index/query/QueryFilterParser.java +++ b/src/main/java/org/elasticsearch/index/query/QueryFilterParser.java @@ -29,7 +29,7 @@ /** * */ -public class QueryFilterParser extends BaseFilterParserTemp { +public class QueryFilterParser implements FilterParser { public static final String NAME = "query"; diff --git a/src/main/java/org/elasticsearch/index/query/RangeFilterBuilder.java b/src/main/java/org/elasticsearch/index/query/RangeFilterBuilder.java index c6dec071173cb..42753179b0725 100644 --- a/src/main/java/org/elasticsearch/index/query/RangeFilterBuilder.java +++ b/src/main/java/org/elasticsearch/index/query/RangeFilterBuilder.java @@ -387,9 +387,4 @@ protected void doXContent(XContentBuilder builder, Params params) throws IOExcep builder.endObject(); } - - @Override - protected String parserName() { - return RangeFilterParser.NAME; - } } diff --git a/src/main/java/org/elasticsearch/index/query/RangeFilterParser.java b/src/main/java/org/elasticsearch/index/query/RangeFilterParser.java index ab8956062ac57..83650aecd5d2c 100644 --- a/src/main/java/org/elasticsearch/index/query/RangeFilterParser.java +++ b/src/main/java/org/elasticsearch/index/query/RangeFilterParser.java @@ -38,7 +38,7 @@ /** * */ -public class RangeFilterParser extends BaseFilterParserTemp { +public class RangeFilterParser implements FilterParser { public static final String NAME = "range"; diff --git a/src/main/java/org/elasticsearch/index/query/RegexpFilterBuilder.java b/src/main/java/org/elasticsearch/index/query/RegexpFilterBuilder.java index 00dcd1178f545..f730c084be3a2 100644 --- a/src/main/java/org/elasticsearch/index/query/RegexpFilterBuilder.java +++ b/src/main/java/org/elasticsearch/index/query/RegexpFilterBuilder.java @@ -105,9 +105,4 @@ public void doXContent(XContentBuilder builder, Params params) throws IOExceptio } builder.endObject(); } - - @Override - protected String parserName() { - return RegexpFilterParser.NAME; - } } diff --git a/src/main/java/org/elasticsearch/index/query/RegexpFilterParser.java b/src/main/java/org/elasticsearch/index/query/RegexpFilterParser.java index e3d5c86f75093..9612812ffe9f8 100644 --- a/src/main/java/org/elasticsearch/index/query/RegexpFilterParser.java +++ b/src/main/java/org/elasticsearch/index/query/RegexpFilterParser.java @@ -34,7 +34,7 @@ /** * */ -public class RegexpFilterParser extends BaseFilterParserTemp { +public class RegexpFilterParser implements FilterParser { public static final String NAME = "regexp"; diff --git a/src/main/java/org/elasticsearch/index/query/ScriptFilterBuilder.java b/src/main/java/org/elasticsearch/index/query/ScriptFilterBuilder.java index b7884e9918bdb..89f0fe7f0336e 100644 --- a/src/main/java/org/elasticsearch/index/query/ScriptFilterBuilder.java +++ b/src/main/java/org/elasticsearch/index/query/ScriptFilterBuilder.java @@ -91,9 +91,4 @@ protected void doXContent(XContentBuilder builder, Params params) throws IOExcep } builder.endObject(); } - - @Override - protected String parserName() { - return ScriptFilterParser.NAME; - } } \ No newline at end of file diff --git a/src/main/java/org/elasticsearch/index/query/ScriptFilterParser.java b/src/main/java/org/elasticsearch/index/query/ScriptFilterParser.java index 7d7f39a0945fd..7e4b59a574823 100644 --- a/src/main/java/org/elasticsearch/index/query/ScriptFilterParser.java +++ b/src/main/java/org/elasticsearch/index/query/ScriptFilterParser.java @@ -46,7 +46,7 @@ /** * */ -public class ScriptFilterParser extends BaseFilterParserTemp { +public class ScriptFilterParser implements FilterParser { public static final String NAME = "script"; diff --git a/src/main/java/org/elasticsearch/index/query/TermFilterBuilder.java b/src/main/java/org/elasticsearch/index/query/TermFilterBuilder.java index 99f57d1260be1..3ca5069127dc1 100644 --- a/src/main/java/org/elasticsearch/index/query/TermFilterBuilder.java +++ b/src/main/java/org/elasticsearch/index/query/TermFilterBuilder.java @@ -114,9 +114,4 @@ public void doXContent(XContentBuilder builder, Params params) throws IOExceptio } builder.endObject(); } - - @Override - protected String parserName() { - return TermFilterParser.NAME; - } } \ No newline at end of file diff --git a/src/main/java/org/elasticsearch/index/query/TermFilterParser.java b/src/main/java/org/elasticsearch/index/query/TermFilterParser.java index e69ed9da13daf..0224a6384da93 100644 --- a/src/main/java/org/elasticsearch/index/query/TermFilterParser.java +++ b/src/main/java/org/elasticsearch/index/query/TermFilterParser.java @@ -33,7 +33,7 @@ /** * */ -public class TermFilterParser extends BaseFilterParserTemp { +public class TermFilterParser implements FilterParser { public static final String NAME = "term"; diff --git a/src/main/java/org/elasticsearch/index/query/TermsFilterBuilder.java b/src/main/java/org/elasticsearch/index/query/TermsFilterBuilder.java index f2f340bf1efa4..d753235e341e7 100644 --- a/src/main/java/org/elasticsearch/index/query/TermsFilterBuilder.java +++ b/src/main/java/org/elasticsearch/index/query/TermsFilterBuilder.java @@ -146,9 +146,4 @@ public void doXContent(XContentBuilder builder, Params params) throws IOExceptio builder.endObject(); } - - @Override - protected String parserName() { - return TermsFilterParser.NAME; - } } \ No newline at end of file diff --git a/src/main/java/org/elasticsearch/index/query/TermsFilterParser.java b/src/main/java/org/elasticsearch/index/query/TermsFilterParser.java index 9ac8cd6f5f4f0..ce8a812266511 100644 --- a/src/main/java/org/elasticsearch/index/query/TermsFilterParser.java +++ b/src/main/java/org/elasticsearch/index/query/TermsFilterParser.java @@ -43,7 +43,7 @@ /** * */ -public class TermsFilterParser extends BaseFilterParserTemp { +public class TermsFilterParser implements FilterParser { public static final String NAME = "terms"; private Client client; diff --git a/src/main/java/org/elasticsearch/index/query/TermsLookupFilterBuilder.java b/src/main/java/org/elasticsearch/index/query/TermsLookupFilterBuilder.java index e2a6a752030a9..1a9473ede4068 100644 --- a/src/main/java/org/elasticsearch/index/query/TermsLookupFilterBuilder.java +++ b/src/main/java/org/elasticsearch/index/query/TermsLookupFilterBuilder.java @@ -24,7 +24,7 @@ import java.io.IOException; /** - * A filter for a field based on several terms matching on any of them. + * A filer for a field based on several terms matching on any of them. */ public class TermsLookupFilterBuilder extends BaseFilterBuilder { @@ -117,9 +117,4 @@ public void doXContent(XContentBuilder builder, Params params) throws IOExceptio builder.endObject(); } - - @Override - protected String parserName() { - return TermsFilterParser.NAME; - } } \ No newline at end of file diff --git a/src/main/java/org/elasticsearch/index/query/TypeFilterBuilder.java b/src/main/java/org/elasticsearch/index/query/TypeFilterBuilder.java index 67144b3c64aba..fe939d0ba4753 100644 --- a/src/main/java/org/elasticsearch/index/query/TypeFilterBuilder.java +++ b/src/main/java/org/elasticsearch/index/query/TypeFilterBuilder.java @@ -37,9 +37,4 @@ protected void doXContent(XContentBuilder builder, Params params) throws IOExcep builder.field("value", type); builder.endObject(); } - - @Override - protected String parserName() { - return TypeFilterParser.NAME; - } } \ No newline at end of file diff --git a/src/main/java/org/elasticsearch/index/query/TypeFilterParser.java b/src/main/java/org/elasticsearch/index/query/TypeFilterParser.java index d45eec908b923..6c9e9523e7642 100644 --- a/src/main/java/org/elasticsearch/index/query/TypeFilterParser.java +++ b/src/main/java/org/elasticsearch/index/query/TypeFilterParser.java @@ -31,7 +31,7 @@ import java.io.IOException; -public class TypeFilterParser extends BaseFilterParserTemp { +public class TypeFilterParser implements FilterParser { public static final String NAME = "type"; diff --git a/src/main/java/org/elasticsearch/index/query/WrapperFilterBuilder.java b/src/main/java/org/elasticsearch/index/query/WrapperFilterBuilder.java index b9de32a83d83a..8a63c0a4a1624 100644 --- a/src/main/java/org/elasticsearch/index/query/WrapperFilterBuilder.java +++ b/src/main/java/org/elasticsearch/index/query/WrapperFilterBuilder.java @@ -59,9 +59,4 @@ protected void doXContent(XContentBuilder builder, Params params) throws IOExcep builder.field("filter", source, offset, length); builder.endObject(); } - - @Override - protected String parserName() { - return WrapperFilterParser.NAME; - } } diff --git a/src/main/java/org/elasticsearch/index/query/WrapperFilterParser.java b/src/main/java/org/elasticsearch/index/query/WrapperFilterParser.java index 8a4be3de127d8..35ca872445370 100644 --- a/src/main/java/org/elasticsearch/index/query/WrapperFilterParser.java +++ b/src/main/java/org/elasticsearch/index/query/WrapperFilterParser.java @@ -29,7 +29,7 @@ /** * Filter parser for embedded filter. */ -public class WrapperFilterParser extends BaseFilterParserTemp { +public class WrapperFilterParser implements FilterParser { public static final String NAME = "wrapper"; diff --git a/src/test/java/org/elasticsearch/index/query/guice/MyJsonFilterParser.java b/src/test/java/org/elasticsearch/index/query/guice/MyJsonFilterParser.java index 526c166aa2148..09b53d32ba425 100644 --- a/src/test/java/org/elasticsearch/index/query/guice/MyJsonFilterParser.java +++ b/src/test/java/org/elasticsearch/index/query/guice/MyJsonFilterParser.java @@ -25,7 +25,9 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.index.AbstractIndexComponent; import org.elasticsearch.index.Index; -import org.elasticsearch.index.query.*; +import org.elasticsearch.index.query.FilterParser; +import org.elasticsearch.index.query.QueryParseContext; +import org.elasticsearch.index.query.QueryParsingException; import org.elasticsearch.index.settings.IndexSettings; import java.io.IOException; @@ -56,12 +58,6 @@ public Filter parse(QueryParseContext parseContext) throws IOException, QueryPar return null; } - @Override - public FilterBuilder fromXContent(QueryParseContext parseContext) throws IOException, QueryParsingException { - Filter filter = parse(parseContext); - return new FilterWrappingFilterBuilder(filter); - } - public Settings settings() { return settings; } diff --git a/src/test/java/org/elasticsearch/index/query/plugin/PluginJsonFilterParser.java b/src/test/java/org/elasticsearch/index/query/plugin/PluginJsonFilterParser.java index 399cbcae992d3..194060e709cd6 100644 --- a/src/test/java/org/elasticsearch/index/query/plugin/PluginJsonFilterParser.java +++ b/src/test/java/org/elasticsearch/index/query/plugin/PluginJsonFilterParser.java @@ -25,7 +25,9 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.index.AbstractIndexComponent; import org.elasticsearch.index.Index; -import org.elasticsearch.index.query.*; +import org.elasticsearch.index.query.FilterParser; +import org.elasticsearch.index.query.QueryParseContext; +import org.elasticsearch.index.query.QueryParsingException; import org.elasticsearch.index.settings.IndexSettings; import java.io.IOException; @@ -56,12 +58,6 @@ public Filter parse(QueryParseContext parseContext) throws IOException, QueryPar return null; } - @Override - public FilterBuilder fromXContent(QueryParseContext parseContext) throws IOException, QueryParsingException { - Filter filter = parse(parseContext); - return new FilterWrappingFilterBuilder(filter); - } - public Settings settings() { return settings; }