From 90209d8dffb4837277395583de81addd9da8fb33 Mon Sep 17 00:00:00 2001 From: kimchy Date: Thu, 7 Jul 2011 01:38:17 +0300 Subject: [PATCH] move things around a bit... --- .../index/mapper/MapperService.java | 2 +- .../index/query/HasChildFilterParser.java | 2 +- .../index/query/HasChildQueryParser.java | 2 +- .../{type/nested => }/NestedQueryBuilder.java | 4 +--- .../{type/nested => }/NestedQueryParser.java | 7 +++---- .../index/query/QueryBuilders.java | 1 - .../index/query/TopChildrenQueryParser.java | 2 +- .../type => search}/child/ChildCollector.java | 2 +- .../type => search}/child/HasChildFilter.java | 2 +- .../type => search}/child/TopChildrenQuery.java | 17 ++++++++++++++--- .../type => search}/nested/BlockJoinQuery.java | 2 +- .../nested/NestedDocsFilter.java | 2 +- .../nested/NonNestedDocsFilter.java | 2 +- .../indices/query/IndicesQueriesRegistry.java | 1 - 14 files changed, 27 insertions(+), 21 deletions(-) rename modules/elasticsearch/src/main/java/org/elasticsearch/index/query/{type/nested => }/NestedQueryBuilder.java (93%) rename modules/elasticsearch/src/main/java/org/elasticsearch/index/query/{type/nested => }/NestedQueryParser.java (96%) rename modules/elasticsearch/src/main/java/org/elasticsearch/index/{query/type => search}/child/ChildCollector.java (98%) rename modules/elasticsearch/src/main/java/org/elasticsearch/index/{query/type => search}/child/HasChildFilter.java (98%) rename modules/elasticsearch/src/main/java/org/elasticsearch/index/{query/type => search}/child/TopChildrenQuery.java (95%) rename modules/elasticsearch/src/main/java/org/elasticsearch/index/{query/type => search}/nested/BlockJoinQuery.java (99%) rename modules/elasticsearch/src/main/java/org/elasticsearch/index/{query/type => search}/nested/NestedDocsFilter.java (97%) rename modules/elasticsearch/src/main/java/org/elasticsearch/index/{query/type => search}/nested/NonNestedDocsFilter.java (97%) diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/index/mapper/MapperService.java b/modules/elasticsearch/src/main/java/org/elasticsearch/index/mapper/MapperService.java index a9207c27e63..0d774d05a71 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/index/mapper/MapperService.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/index/mapper/MapperService.java @@ -45,7 +45,7 @@ import org.elasticsearch.index.Index; import org.elasticsearch.index.analysis.AnalysisService; import org.elasticsearch.index.mapper.internal.TypeFieldMapper; import org.elasticsearch.index.mapper.object.ObjectMapper; -import org.elasticsearch.index.query.type.nested.NonNestedDocsFilter; +import org.elasticsearch.index.search.nested.NonNestedDocsFilter; import org.elasticsearch.index.settings.IndexSettings; import org.elasticsearch.indices.InvalidTypeNameException; import org.elasticsearch.indices.TypeMissingException; diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/index/query/HasChildFilterParser.java b/modules/elasticsearch/src/main/java/org/elasticsearch/index/query/HasChildFilterParser.java index 032d158dd82..8d3069ef902 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/index/query/HasChildFilterParser.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/index/query/HasChildFilterParser.java @@ -26,7 +26,7 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.inject.Inject; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.index.mapper.DocumentMapper; -import org.elasticsearch.index.query.type.child.HasChildFilter; +import org.elasticsearch.index.search.child.HasChildFilter; import org.elasticsearch.search.internal.SearchContext; import java.io.IOException; diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/index/query/HasChildQueryParser.java b/modules/elasticsearch/src/main/java/org/elasticsearch/index/query/HasChildQueryParser.java index 6d8193c5df3..455beeeed0d 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/index/query/HasChildQueryParser.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/index/query/HasChildQueryParser.java @@ -26,7 +26,7 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.inject.Inject; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.index.mapper.DocumentMapper; -import org.elasticsearch.index.query.type.child.HasChildFilter; +import org.elasticsearch.index.search.child.HasChildFilter; import org.elasticsearch.search.internal.SearchContext; import java.io.IOException; diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/index/query/type/nested/NestedQueryBuilder.java b/modules/elasticsearch/src/main/java/org/elasticsearch/index/query/NestedQueryBuilder.java similarity index 93% rename from modules/elasticsearch/src/main/java/org/elasticsearch/index/query/type/nested/NestedQueryBuilder.java rename to modules/elasticsearch/src/main/java/org/elasticsearch/index/query/NestedQueryBuilder.java index 483f6ef7917..01f7a784e77 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/index/query/type/nested/NestedQueryBuilder.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/index/query/NestedQueryBuilder.java @@ -17,11 +17,9 @@ * under the License. */ -package org.elasticsearch.index.query.type.nested; +package org.elasticsearch.index.query; import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.index.query.BaseQueryBuilder; -import org.elasticsearch.index.query.QueryBuilder; import java.io.IOException; diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/index/query/type/nested/NestedQueryParser.java b/modules/elasticsearch/src/main/java/org/elasticsearch/index/query/NestedQueryParser.java similarity index 96% rename from modules/elasticsearch/src/main/java/org/elasticsearch/index/query/type/nested/NestedQueryParser.java rename to modules/elasticsearch/src/main/java/org/elasticsearch/index/query/NestedQueryParser.java index 99a9db7526f..de0ac27be06 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/index/query/type/nested/NestedQueryParser.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/index/query/NestedQueryParser.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.index.query.type.nested; +package org.elasticsearch.index.query; import org.apache.lucene.index.IndexReader; import org.apache.lucene.search.DeletionAwareConstantScoreQuery; @@ -30,9 +30,8 @@ import org.elasticsearch.common.inject.Inject; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.index.mapper.MapperService; import org.elasticsearch.index.mapper.object.ObjectMapper; -import org.elasticsearch.index.query.QueryParseContext; -import org.elasticsearch.index.query.QueryParser; -import org.elasticsearch.index.query.QueryParsingException; +import org.elasticsearch.index.search.nested.BlockJoinQuery; +import org.elasticsearch.index.search.nested.NonNestedDocsFilter; import java.io.IOException; diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/index/query/QueryBuilders.java b/modules/elasticsearch/src/main/java/org/elasticsearch/index/query/QueryBuilders.java index ccf4bc2711b..8b6eb30ab44 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/index/query/QueryBuilders.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/index/query/QueryBuilders.java @@ -20,7 +20,6 @@ package org.elasticsearch.index.query; import org.elasticsearch.common.Nullable; -import org.elasticsearch.index.query.type.nested.NestedQueryBuilder; /** * A static factory for simple "import static" usage. diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/index/query/TopChildrenQueryParser.java b/modules/elasticsearch/src/main/java/org/elasticsearch/index/query/TopChildrenQueryParser.java index 116c83a041c..245ca75bb89 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/index/query/TopChildrenQueryParser.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/index/query/TopChildrenQueryParser.java @@ -25,7 +25,7 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.inject.Inject; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.index.mapper.DocumentMapper; -import org.elasticsearch.index.query.type.child.TopChildrenQuery; +import org.elasticsearch.index.search.child.TopChildrenQuery; import org.elasticsearch.search.internal.SearchContext; import java.io.IOException; diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/index/query/type/child/ChildCollector.java b/modules/elasticsearch/src/main/java/org/elasticsearch/index/search/child/ChildCollector.java similarity index 98% rename from modules/elasticsearch/src/main/java/org/elasticsearch/index/query/type/child/ChildCollector.java rename to modules/elasticsearch/src/main/java/org/elasticsearch/index/search/child/ChildCollector.java index a445a1453be..827132518c5 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/index/query/type/child/ChildCollector.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/index/search/child/ChildCollector.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.index.query.type.child; +package org.elasticsearch.index.search.child; import org.apache.lucene.index.IndexReader; import org.apache.lucene.search.Collector; diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/index/query/type/child/HasChildFilter.java b/modules/elasticsearch/src/main/java/org/elasticsearch/index/search/child/HasChildFilter.java similarity index 98% rename from modules/elasticsearch/src/main/java/org/elasticsearch/index/query/type/child/HasChildFilter.java rename to modules/elasticsearch/src/main/java/org/elasticsearch/index/search/child/HasChildFilter.java index fefcd39001c..c0c1c28224b 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/index/query/type/child/HasChildFilter.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/index/search/child/HasChildFilter.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.index.query.type.child; +package org.elasticsearch.index.search.child; import org.apache.lucene.index.IndexReader; import org.apache.lucene.search.Collector; diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/index/query/type/child/TopChildrenQuery.java b/modules/elasticsearch/src/main/java/org/elasticsearch/index/search/child/TopChildrenQuery.java similarity index 95% rename from modules/elasticsearch/src/main/java/org/elasticsearch/index/query/type/child/TopChildrenQuery.java rename to modules/elasticsearch/src/main/java/org/elasticsearch/index/search/child/TopChildrenQuery.java index 9136b320186..aaf1cf3753b 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/index/query/type/child/TopChildrenQuery.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/index/search/child/TopChildrenQuery.java @@ -17,11 +17,18 @@ * under the License. */ -package org.elasticsearch.index.query.type.child; +package org.elasticsearch.index.search.child; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.Term; -import org.apache.lucene.search.*; +import org.apache.lucene.search.Explanation; +import org.apache.lucene.search.Query; +import org.apache.lucene.search.ScoreDoc; +import org.apache.lucene.search.Scorer; +import org.apache.lucene.search.Searcher; +import org.apache.lucene.search.Similarity; +import org.apache.lucene.search.TopDocs; +import org.apache.lucene.search.Weight; import org.apache.lucene.util.ToStringUtils; import org.elasticsearch.ElasticSearchIllegalArgumentException; import org.elasticsearch.ElasticSearchIllegalStateException; @@ -32,7 +39,11 @@ import org.elasticsearch.search.internal.ScopePhase; import org.elasticsearch.search.internal.SearchContext; import java.io.IOException; -import java.util.*; +import java.util.Arrays; +import java.util.Comparator; +import java.util.HashMap; +import java.util.Map; +import java.util.Set; /** * @author kimchy (shay.banon) diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/index/query/type/nested/BlockJoinQuery.java b/modules/elasticsearch/src/main/java/org/elasticsearch/index/search/nested/BlockJoinQuery.java similarity index 99% rename from modules/elasticsearch/src/main/java/org/elasticsearch/index/query/type/nested/BlockJoinQuery.java rename to modules/elasticsearch/src/main/java/org/elasticsearch/index/search/nested/BlockJoinQuery.java index a5477129985..7952f981b9a 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/index/query/type/nested/BlockJoinQuery.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/index/search/nested/BlockJoinQuery.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.index.query.type.nested; +package org.elasticsearch.index.search.nested; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.Term; diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/index/query/type/nested/NestedDocsFilter.java b/modules/elasticsearch/src/main/java/org/elasticsearch/index/search/nested/NestedDocsFilter.java similarity index 97% rename from modules/elasticsearch/src/main/java/org/elasticsearch/index/query/type/nested/NestedDocsFilter.java rename to modules/elasticsearch/src/main/java/org/elasticsearch/index/search/nested/NestedDocsFilter.java index 8bd91401bdc..27ee0d678be 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/index/query/type/nested/NestedDocsFilter.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/index/search/nested/NestedDocsFilter.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.index.query.type.nested; +package org.elasticsearch.index.search.nested; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.Term; diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/index/query/type/nested/NonNestedDocsFilter.java b/modules/elasticsearch/src/main/java/org/elasticsearch/index/search/nested/NonNestedDocsFilter.java similarity index 97% rename from modules/elasticsearch/src/main/java/org/elasticsearch/index/query/type/nested/NonNestedDocsFilter.java rename to modules/elasticsearch/src/main/java/org/elasticsearch/index/search/nested/NonNestedDocsFilter.java index 9c7971588c6..93d79145760 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/index/query/type/nested/NonNestedDocsFilter.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/index/search/nested/NonNestedDocsFilter.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.index.query.type.nested; +package org.elasticsearch.index.search.nested; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.Term; diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/indices/query/IndicesQueriesRegistry.java b/modules/elasticsearch/src/main/java/org/elasticsearch/indices/query/IndicesQueriesRegistry.java index ff93df7c261..7e75606d575 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/indices/query/IndicesQueriesRegistry.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/indices/query/IndicesQueriesRegistry.java @@ -24,7 +24,6 @@ import org.elasticsearch.common.collect.Maps; import org.elasticsearch.common.inject.Inject; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.index.query.*; -import org.elasticsearch.index.query.type.nested.NestedQueryParser; import java.util.Map;