From 1715aac0e629844b151617ebdb70eb7214a059c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20B=C3=BCscher?= Date: Tue, 12 May 2015 15:13:21 +0200 Subject: [PATCH] Moving Streamable declaration of query builders up to the base interface --- .../java/org/elasticsearch/index/query/IdsQueryBuilder.java | 4 ++-- .../org/elasticsearch/index/query/MatchAllQueryBuilder.java | 3 +-- .../java/org/elasticsearch/index/query/TermQueryBuilder.java | 4 ++-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/main/java/org/elasticsearch/index/query/IdsQueryBuilder.java b/src/main/java/org/elasticsearch/index/query/IdsQueryBuilder.java index bb60cc7e31264..5df680508ffe7 100644 --- a/src/main/java/org/elasticsearch/index/query/IdsQueryBuilder.java +++ b/src/main/java/org/elasticsearch/index/query/IdsQueryBuilder.java @@ -25,7 +25,6 @@ import org.apache.lucene.search.Query; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.io.stream.Streamable; import org.elasticsearch.common.lucene.search.Queries; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.index.mapper.Uid; @@ -41,7 +40,7 @@ /** * A query that will return only documents matching specific ids (and a type). */ -public class IdsQueryBuilder extends BaseQueryBuilder implements Streamable, BoostableQueryBuilder { +public class IdsQueryBuilder extends BaseQueryBuilder implements BoostableQueryBuilder { private List types = new ArrayList<>(); @@ -154,6 +153,7 @@ protected String parserName() { return IdsQueryParser.NAME; } + @Override public Query toQuery(QueryParseContext parseContext) throws IOException, QueryParsingException { if (this.ids.isEmpty()) { return Queries.newMatchNoDocsQuery(); diff --git a/src/main/java/org/elasticsearch/index/query/MatchAllQueryBuilder.java b/src/main/java/org/elasticsearch/index/query/MatchAllQueryBuilder.java index a39587822264a..fe5c1cf3f80c0 100644 --- a/src/main/java/org/elasticsearch/index/query/MatchAllQueryBuilder.java +++ b/src/main/java/org/elasticsearch/index/query/MatchAllQueryBuilder.java @@ -23,7 +23,6 @@ import org.apache.lucene.search.Query; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.io.stream.Streamable; import org.elasticsearch.common.lucene.search.Queries; import org.elasticsearch.common.xcontent.XContentBuilder; @@ -32,7 +31,7 @@ /** * A query that matches on all documents. */ -public class MatchAllQueryBuilder extends BaseQueryBuilder implements Streamable, BoostableQueryBuilder { +public class MatchAllQueryBuilder extends BaseQueryBuilder implements BoostableQueryBuilder { private float boost = 1.0f; diff --git a/src/main/java/org/elasticsearch/index/query/TermQueryBuilder.java b/src/main/java/org/elasticsearch/index/query/TermQueryBuilder.java index 4343049acc27e..4496e0134cdc9 100644 --- a/src/main/java/org/elasticsearch/index/query/TermQueryBuilder.java +++ b/src/main/java/org/elasticsearch/index/query/TermQueryBuilder.java @@ -25,7 +25,6 @@ import org.apache.lucene.util.BytesRef; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.io.stream.Streamable; import org.elasticsearch.common.lucene.BytesRefs; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.index.mapper.MapperService; @@ -36,7 +35,7 @@ /** * A Query that matches documents containing a term. */ -public class TermQueryBuilder extends BaseQueryBuilder implements Streamable, BoostableQueryBuilder { +public class TermQueryBuilder extends BaseQueryBuilder implements BoostableQueryBuilder { private String fieldName; @@ -228,6 +227,7 @@ protected String parserName() { return TermQueryParser.NAME; } + @Override public void readFrom(StreamInput in) throws IOException { fieldName = in.readString(); value = in.readGenericValue();