diff --git a/lucene/contrib/sandbox/src/java/org/apache/lucene/sandbox/queries/SlowCollatedTermRangeTermsEnum.java b/lucene/contrib/sandbox/src/java/org/apache/lucene/sandbox/queries/SlowCollatedTermRangeTermsEnum.java index f299ff73290..56caec6c979 100644 --- a/lucene/contrib/sandbox/src/java/org/apache/lucene/sandbox/queries/SlowCollatedTermRangeTermsEnum.java +++ b/lucene/contrib/sandbox/src/java/org/apache/lucene/sandbox/queries/SlowCollatedTermRangeTermsEnum.java @@ -21,7 +21,7 @@ import java.io.IOException; import java.text.Collator; import org.apache.lucene.index.TermsEnum; -import org.apache.lucene.search.FilteredTermsEnum; +import org.apache.lucene.index.FilteredTermsEnum; import org.apache.lucene.util.BytesRef; /** diff --git a/lucene/contrib/sandbox/src/java/org/apache/lucene/sandbox/queries/regex/RegexQuery.java b/lucene/contrib/sandbox/src/java/org/apache/lucene/sandbox/queries/regex/RegexQuery.java index 47706941c84..aeb71d163a2 100644 --- a/lucene/contrib/sandbox/src/java/org/apache/lucene/sandbox/queries/regex/RegexQuery.java +++ b/lucene/contrib/sandbox/src/java/org/apache/lucene/sandbox/queries/regex/RegexQuery.java @@ -18,7 +18,7 @@ package org.apache.lucene.sandbox.queries.regex; */ import org.apache.lucene.search.MultiTermQuery; -import org.apache.lucene.search.FilteredTermsEnum; +import org.apache.lucene.index.FilteredTermsEnum; import org.apache.lucene.search.RegexpQuery; // javadoc import org.apache.lucene.index.Term; import org.apache.lucene.index.Terms; diff --git a/lucene/contrib/sandbox/src/java/org/apache/lucene/sandbox/queries/regex/RegexTermsEnum.java b/lucene/contrib/sandbox/src/java/org/apache/lucene/sandbox/queries/regex/RegexTermsEnum.java index e67f94d2269..870ccec0240 100644 --- a/lucene/contrib/sandbox/src/java/org/apache/lucene/sandbox/queries/regex/RegexTermsEnum.java +++ b/lucene/contrib/sandbox/src/java/org/apache/lucene/sandbox/queries/regex/RegexTermsEnum.java @@ -17,7 +17,7 @@ package org.apache.lucene.sandbox.queries.regex; * limitations under the License. */ -import org.apache.lucene.search.FilteredTermsEnum; +import org.apache.lucene.index.FilteredTermsEnum; import org.apache.lucene.index.Term; import org.apache.lucene.index.TermsEnum; import org.apache.lucene.util.BytesRef; diff --git a/lucene/src/java/org/apache/lucene/index/AutomatonTermsEnum.java b/lucene/src/java/org/apache/lucene/index/AutomatonTermsEnum.java index 9bd0554b539..a9d103dd7c8 100644 --- a/lucene/src/java/org/apache/lucene/index/AutomatonTermsEnum.java +++ b/lucene/src/java/org/apache/lucene/index/AutomatonTermsEnum.java @@ -20,7 +20,6 @@ package org.apache.lucene.index; import java.io.IOException; import java.util.Comparator; -import org.apache.lucene.search.FilteredTermsEnum; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.IntsRef; import org.apache.lucene.util.automaton.ByteRunAutomaton; diff --git a/lucene/src/java/org/apache/lucene/search/FilteredTermsEnum.java b/lucene/src/java/org/apache/lucene/index/FilteredTermsEnum.java similarity index 96% rename from lucene/src/java/org/apache/lucene/search/FilteredTermsEnum.java rename to lucene/src/java/org/apache/lucene/index/FilteredTermsEnum.java index 898e4a59ef6..3ef49cb8c84 100644 --- a/lucene/src/java/org/apache/lucene/search/FilteredTermsEnum.java +++ b/lucene/src/java/org/apache/lucene/index/FilteredTermsEnum.java @@ -1,4 +1,4 @@ -package org.apache.lucene.search; +package org.apache.lucene.index; /** * Licensed to the Apache Software Foundation (ASF) under one or more @@ -21,15 +21,9 @@ import java.io.IOException; import java.util.Comparator; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.index.TermState; -import org.apache.lucene.index.TermsEnum; -import org.apache.lucene.index.DocsEnum; -import org.apache.lucene.index.DocsAndPositionsEnum; import org.apache.lucene.util.AttributeSource; import org.apache.lucene.util.Bits; -// TODO: move this class to oal.index - /** * Abstract class for enumerating a subset of all terms. * diff --git a/lucene/src/java/org/apache/lucene/search/SingleTermsEnum.java b/lucene/src/java/org/apache/lucene/index/SingleTermsEnum.java similarity index 84% rename from lucene/src/java/org/apache/lucene/search/SingleTermsEnum.java rename to lucene/src/java/org/apache/lucene/index/SingleTermsEnum.java index c890f504f2e..1c09c44beef 100644 --- a/lucene/src/java/org/apache/lucene/search/SingleTermsEnum.java +++ b/lucene/src/java/org/apache/lucene/index/SingleTermsEnum.java @@ -1,4 +1,4 @@ -package org.apache.lucene.search; +package org.apache.lucene.index; /** * Licensed to the Apache Software Foundation (ASF) under one or more @@ -19,15 +19,16 @@ package org.apache.lucene.search; import java.io.IOException; -import org.apache.lucene.index.TermsEnum; +import org.apache.lucene.search.MultiTermQuery; // javadocs import org.apache.lucene.util.BytesRef; /** * Subclass of FilteredTermsEnum for enumerating a single term. *
- * This can be used by {@link MultiTermQuery}s that need only visit one term, - * but want to preserve MultiTermQuery semantics such as - * {@link MultiTermQuery#rewriteMethod}. + * For example, this can be used by {@link MultiTermQuery}s + * that need only visit one term, but want to preserve + * MultiTermQuery semantics such as {@link + * MultiTermQuery#rewriteMethod}. */ public final class SingleTermsEnum extends FilteredTermsEnum { private final BytesRef singleRef; diff --git a/lucene/src/java/org/apache/lucene/search/FuzzyQuery.java b/lucene/src/java/org/apache/lucene/search/FuzzyQuery.java index fa9f077c8f3..c0a43333d8d 100644 --- a/lucene/src/java/org/apache/lucene/search/FuzzyQuery.java +++ b/lucene/src/java/org/apache/lucene/search/FuzzyQuery.java @@ -17,6 +17,9 @@ package org.apache.lucene.search; * limitations under the License. */ +import java.io.IOException; + +import org.apache.lucene.index.SingleTermsEnum; import org.apache.lucene.index.Term; import org.apache.lucene.index.Terms; import org.apache.lucene.index.TermsEnum; @@ -24,8 +27,6 @@ import org.apache.lucene.util.AttributeSource; import org.apache.lucene.util.ToStringUtils; import org.apache.lucene.util.automaton.LevenshteinAutomata; -import java.io.IOException; - /** Implements the fuzzy search query. The similarity measurement * is based on the Levenshtein (edit distance) algorithm. * diff --git a/lucene/src/java/org/apache/lucene/search/FuzzyTermsEnum.java b/lucene/src/java/org/apache/lucene/search/FuzzyTermsEnum.java index c84adb7534f..568b365cb3f 100644 --- a/lucene/src/java/org/apache/lucene/search/FuzzyTermsEnum.java +++ b/lucene/src/java/org/apache/lucene/search/FuzzyTermsEnum.java @@ -28,6 +28,7 @@ import org.apache.lucene.index.Term; import org.apache.lucene.index.TermState; import org.apache.lucene.index.Terms; import org.apache.lucene.index.TermsEnum; +import org.apache.lucene.index.FilteredTermsEnum; import org.apache.lucene.util.Attribute; import org.apache.lucene.util.AttributeImpl; import org.apache.lucene.util.AttributeSource; diff --git a/lucene/src/java/org/apache/lucene/search/MultiTermQuery.java b/lucene/src/java/org/apache/lucene/search/MultiTermQuery.java index aba17817184..da66af0ad13 100644 --- a/lucene/src/java/org/apache/lucene/search/MultiTermQuery.java +++ b/lucene/src/java/org/apache/lucene/search/MultiTermQuery.java @@ -19,7 +19,9 @@ package org.apache.lucene.search; import java.io.IOException; +import org.apache.lucene.index.FilteredTermsEnum; // javadocs import org.apache.lucene.index.IndexReader; +import org.apache.lucene.index.SingleTermsEnum; // javadocs import org.apache.lucene.index.Term; import org.apache.lucene.index.Terms; import org.apache.lucene.index.TermsEnum; diff --git a/lucene/src/java/org/apache/lucene/search/NumericRangeQuery.java b/lucene/src/java/org/apache/lucene/search/NumericRangeQuery.java index 1d0b6628972..b12bbb20b33 100644 --- a/lucene/src/java/org/apache/lucene/search/NumericRangeQuery.java +++ b/lucene/src/java/org/apache/lucene/search/NumericRangeQuery.java @@ -18,17 +18,18 @@ package org.apache.lucene.search; */ import java.io.IOException; -import java.util.LinkedList; import java.util.Comparator; +import java.util.LinkedList; import org.apache.lucene.analysis.NumericTokenStream; // for javadocs import org.apache.lucene.document.NumericField; // for javadocs -import org.apache.lucene.util.NumericUtils; -import org.apache.lucene.util.ToStringUtils; +import org.apache.lucene.index.FilteredTermsEnum; import org.apache.lucene.index.Terms; +import org.apache.lucene.index.TermsEnum; import org.apache.lucene.util.AttributeSource; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.index.TermsEnum; +import org.apache.lucene.util.NumericUtils; +import org.apache.lucene.util.ToStringUtils; /** *
A {@link Query} that matches numeric values within a
@@ -169,7 +170,7 @@ public final class NumericRangeQuery