LUCENE-9319: Clean up package name conflicts for sandbox module (#2023)

This commit is contained in:
Tomoko Uchida 2020-11-03 12:01:02 +09:00 committed by GitHub
parent e7f0294d85
commit 6a7131ee24
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
75 changed files with 417 additions and 114 deletions

View File

@ -194,10 +194,9 @@ configure(project(":lucene:sandbox")) {
project.tasks.withType(RenderJavadocTask) {
// TODO: fix missing javadocs
javadocMissingLevel = "class"
// TODO: clean up split packages
javadocMissingIgnore = [
"org.apache.lucene.search",
"org.apache.lucene.document"
"org.apache.lucene.sandbox.search",
"org.apache.lucene.sandbox.document"
]
}
}

View File

@ -73,7 +73,7 @@ API Changes
in Lucenes IndexWriter. The interface is not sufficient to efficiently
replace the functionality with reasonable efforts. (Simon Willnauer)
* LUCENE-9317 LUCENE-9318 LUCENE-9558: Clean up package name conflicts between modules.
* LUCENE-9317 LUCENE-9318 LUCENE-9319 LUCENE-9558 : Clean up package name conflicts between modules.
See MIGRATE.md for details. (David Ryan, Tomoko Uchida, Uwe Schindler, Dawid Weiss)
Improvements

View File

@ -1,5 +1,13 @@
# Apache Lucene Migration Guide
## Packages in sandbox module are renamed (LUCENE-9319)
Following package names in sandbox module are renamed.
- o.a.l.codecs is renamed to o.a.l.sandbox.codecs
- o.a.l.document is renamed to o.a.l.sandbox.document
- o.a.l.search is renamed to o.a.l.sandbox.search
## Backward codecs are renamed (LUCENE-9318)
o.a.l.codecs package in `lucene-backward-codecs` module is renamed to o.a.l.backward_codecs.

View File

@ -40,8 +40,9 @@ import org.apache.lucene.util.DocIdSetBuilder;
/**
* Query class for searching {@code RangeField} types by a defined {@link Relation}.
* @lucene.internal
*/
abstract class RangeFieldQuery extends Query {
public abstract class RangeFieldQuery extends Query {
/** field name */
final String field;
/** query relation
@ -57,7 +58,7 @@ abstract class RangeFieldQuery extends Query {
final int bytesPerDim;
/** Used by {@code RangeFieldQuery} to check how each internal or leaf node relates to the query. */
enum QueryType {
public enum QueryType {
/** Use this for intersects queries. */
INTERSECTS {
@ -228,7 +229,7 @@ abstract class RangeFieldQuery extends Query {
* @param ranges encoded range values; this is done by the {@code RangeField} implementation
* @param queryType the query relation
*/
RangeFieldQuery(String field, final byte[] ranges, final int numDims, final QueryType queryType) {
protected RangeFieldQuery(String field, final byte[] ranges, final int numDims, final QueryType queryType) {
checkArgs(field, ranges, numDims);
if (queryType == null) {
throw new IllegalArgumentException("Query type cannot be null");
@ -404,6 +405,7 @@ abstract class RangeFieldQuery extends Query {
equalsTo(getClass().cast(o));
}
/** Check equality of two RangeFieldQuery objects */
protected boolean equalsTo(RangeFieldQuery other) {
return Objects.equals(field, other.field) &&
numDims == other.numDims &&

View File

@ -33,7 +33,10 @@ import org.apache.lucene.index.PostingsEnum;
import org.apache.lucene.search.similarities.Similarity.SimScorer;
import org.apache.lucene.util.PriorityQueue;
final class ExactPhraseMatcher extends PhraseMatcher {
/** Expert: Find exact phrases
* @lucene.internal
*/
public final class ExactPhraseMatcher extends PhraseMatcher {
private static class PostingsAndPosition {
private final PostingsEnum postings;
@ -50,7 +53,8 @@ final class ExactPhraseMatcher extends PhraseMatcher {
private final DocIdSetIterator approximation;
private final ImpactsDISI impactsApproximation;
ExactPhraseMatcher(PhraseQuery.PostingsAndFreq[] postings, ScoreMode scoreMode, SimScorer scorer, float matchCost) {
/** Expert: Creates ExactPhraseMatcher instance */
public ExactPhraseMatcher(PhraseQuery.PostingsAndFreq[] postings, ScoreMode scoreMode, SimScorer scorer, float matchCost) {
super(matchCost);
final DocIdSetIterator approximation = ConjunctionDISI.intersectIterators(Arrays.stream(postings).map(p -> p.postings).collect(Collectors.toList()));

View File

@ -19,7 +19,10 @@ package org.apache.lucene.search;
import org.apache.lucene.util.PriorityQueue;
final class HitQueue extends PriorityQueue<ScoreDoc> {
/** Expert: Priority queue containing hit docs
* @lucene.internal
*/
public final class HitQueue extends PriorityQueue<ScoreDoc> {
/**
* Creates a new instance with <code>size</code> elements. If
@ -59,7 +62,7 @@ final class HitQueue extends PriorityQueue<ScoreDoc> {
* @param prePopulate
* specifies whether to pre-populate the queue with sentinel values.
*/
HitQueue(int size, boolean prePopulate) {
public HitQueue(int size, boolean prePopulate) {
super(size, () -> {
if (prePopulate) {
// Always set the doc Id to MAX_VALUE so that it won't be favored by

View File

@ -409,8 +409,9 @@ public class MultiPhraseQuery extends Query {
* Takes the logical union of multiple PostingsEnum iterators.
* <p>
* Note: positions are merged during freq()
* @lucene.internal
*/
static class UnionPostingsEnum extends PostingsEnum {
public static class UnionPostingsEnum extends PostingsEnum {
/** queue ordered by docid */
final DocsQueue docsQueue;
/** cost of this enum: sum of its subs */
@ -423,7 +424,7 @@ public class MultiPhraseQuery extends Query {
/** list of subs (unordered) */
final PostingsEnum[] subs;
UnionPostingsEnum(Collection<PostingsEnum> subs) {
public UnionPostingsEnum(Collection<PostingsEnum> subs) {
docsQueue = new DocsQueue(subs.size());
long cost = 0;
for (PostingsEnum sub : subs) {
@ -575,9 +576,11 @@ public class MultiPhraseQuery extends Query {
}
}
// Slower version of UnionPostingsEnum that delegates offsets and positions, for
// use by MatchesIterator
static class UnionFullPostingsEnum extends UnionPostingsEnum {
/** Slower version of UnionPostingsEnum that delegates offsets and positions, for
use by MatchesIterator
* @lucene.internal
*/
public static class UnionFullPostingsEnum extends UnionPostingsEnum {
int freq = -1;
boolean started = false;
@ -585,7 +588,7 @@ public class MultiPhraseQuery extends Query {
final PriorityQueue<PostingsAndPosition> posQueue;
final Collection<PostingsAndPosition> subs;
UnionFullPostingsEnum(List<PostingsEnum> subs) {
public UnionFullPostingsEnum(List<PostingsEnum> subs) {
super(subs);
this.posQueue = new PriorityQueue<PostingsAndPosition>(subs.size()) {
@Override

View File

@ -29,13 +29,13 @@ import java.util.Map;
* Iteration order is not specified.
* @lucene.internal
*/
final class Multiset<T> extends AbstractCollection<T> {
public final class Multiset<T> extends AbstractCollection<T> {
private final Map<T, Integer> map = new HashMap<>();
private int size;
/** Create an empty {@link Multiset}. */
Multiset() {
public Multiset() {
super();
}

View File

@ -25,8 +25,9 @@ import java.io.IOException;
* To find matches on a document, first advance {@link #approximation} to the
* relevant document, then call {@link #reset()}. Clients can then call
* {@link #nextMatch()} to iterate over the matches
* @lucene.internal
*/
abstract class PhraseMatcher {
public abstract class PhraseMatcher {
private final float matchCost;

View File

@ -304,13 +304,17 @@ public class PhraseQuery extends Query {
v.consumeTerms(this, terms);
}
static class PostingsAndFreq implements Comparable<PostingsAndFreq> {
/** Term postings and position information for phrase matching
* @lucene.internal
*/
public static class PostingsAndFreq implements Comparable<PostingsAndFreq> {
final PostingsEnum postings;
final ImpactsEnum impacts;
final int position;
final Term[] terms;
final int nTerms; // for faster comparisons
/** Creates PostingsAndFreq instance */
public PostingsAndFreq(PostingsEnum postings, ImpactsEnum impacts, int position, Term... terms) {
this.postings = postings;
this.impacts = impacts;
@ -413,7 +417,7 @@ public class PhraseQuery extends Query {
* This is for use by {@link TwoPhaseIterator#matchCost} implementations.
* @param termsEnum The term is the term at which this TermsEnum is positioned.
*/
static float termPositionsCost(TermsEnum termsEnum) throws IOException {
public static float termPositionsCost(TermsEnum termsEnum) throws IOException {
int docFreq = termsEnum.docFreq();
assert docFreq > 0;
long totalTermFreq = termsEnum.totalTermFreq();

View File

@ -23,13 +23,17 @@ import org.apache.lucene.index.LeafReaderContext;
import org.apache.lucene.search.similarities.Similarity;
import org.apache.lucene.search.similarities.Similarity.SimScorer;
abstract class PhraseWeight extends Weight {
/** Expert: Weight class for phrase matching */
public abstract class PhraseWeight extends Weight {
final ScoreMode scoreMode;
final Similarity.SimScorer stats;
final Similarity similarity;
final String field;
/** Expert: Creates PhraseWeight instance
* @lucene.internal
*/
protected PhraseWeight(Query query, String field, IndexSearcher searcher, ScoreMode scoreMode) throws IOException {
super(query);
this.scoreMode = scoreMode;

View File

@ -52,8 +52,10 @@ import org.apache.lucene.util.FixedBitSet;
* Similarly, for doc "a b c b a f g", query "c b"~2
* would get same score as "g f"~2, although "c b"~2 could be matched twice.
* We may want to fix this in the future (currently not, for performance reasons).
*
* @lucene.internal
*/
final class SloppyPhraseMatcher extends PhraseMatcher {
public final class SloppyPhraseMatcher extends PhraseMatcher {
private final PhrasePositions[] phrasePositions;
@ -81,7 +83,7 @@ final class SloppyPhraseMatcher extends PhraseMatcher {
private boolean positioned;
private int matchLength;
SloppyPhraseMatcher(PhraseQuery.PostingsAndFreq[] postings, int slop, ScoreMode scoreMode, SimScorer scorer, float matchCost, boolean captureLeadMatch) {
public SloppyPhraseMatcher(PhraseQuery.PostingsAndFreq[] postings, int slop, ScoreMode scoreMode, SimScorer scorer, float matchCost, boolean captureLeadMatch) {
super(matchCost);
this.slop = slop;
this.numPostings = postings.length;

View File

@ -24,8 +24,9 @@ import org.apache.lucene.index.PostingsEnum;
import org.apache.lucene.index.SlowImpactsEnum;
/** Expert: A <code>Scorer</code> for documents matching a <code>Term</code>.
* @lucene.internal
*/
final class TermScorer extends Scorer {
public final class TermScorer extends Scorer {
private final PostingsEnum postingsEnum;
private final ImpactsEnum impactsEnum;
private final DocIdSetIterator iterator;
@ -35,7 +36,7 @@ final class TermScorer extends Scorer {
/**
* Construct a {@link TermScorer} that will iterate all documents.
*/
TermScorer(Weight weight, PostingsEnum postingsEnum, LeafSimScorer docScorer) {
public TermScorer(Weight weight, PostingsEnum postingsEnum, LeafSimScorer docScorer) {
super(weight);
iterator = this.postingsEnum = postingsEnum;
impactsEnum = new SlowImpactsEnum(postingsEnum);
@ -60,7 +61,8 @@ final class TermScorer extends Scorer {
return postingsEnum.docID();
}
final int freq() throws IOException {
/** Returns term frequency in the current document. */
public final int freq() throws IOException {
return postingsEnum.freq();
}

View File

@ -34,8 +34,10 @@ import org.apache.lucene.util.PriorityQueue;
public abstract class TopDocsCollector<T extends ScoreDoc> implements Collector {
/** This is used in case topDocs() is called with illegal parameters, or there
* simply aren't (enough) results. */
protected static final TopDocs EMPTY_TOPDOCS = new TopDocs(new TotalHits(0, TotalHits.Relation.EQUAL_TO), new ScoreDoc[0]);
* simply aren't (enough) results.
* @lucene.internal
*/
public static final TopDocs EMPTY_TOPDOCS = new TopDocs(new TotalHits(0, TotalHits.Relation.EQUAL_TO), new ScoreDoc[0]);
/**
* The priority queue which holds the top documents. Note that different

View File

@ -38,9 +38,10 @@ import org.apache.lucene.search.MaxScoreAccumulator.DocAndScore;
*/
public abstract class TopScoreDocCollector extends TopDocsCollector<ScoreDoc> {
abstract static class ScorerLeafCollector implements LeafCollector {
/** Scorable leaf collector */
public abstract static class ScorerLeafCollector implements LeafCollector {
Scorable scorer;
protected Scorable scorer;
@Override
public void setScorer(Scorable scorer) throws IOException {

View File

@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.lucene.codecs.idversion;
package org.apache.lucene.sandbox.codecs.idversion;
import java.io.IOException;

View File

@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.lucene.codecs.idversion;
package org.apache.lucene.sandbox.codecs.idversion;
import java.io.IOException;

View File

@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.lucene.codecs.idversion;
package org.apache.lucene.sandbox.codecs.idversion;
import java.io.IOException;

View File

@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.lucene.codecs.idversion;
package org.apache.lucene.sandbox.codecs.idversion;
import java.io.IOException;
import java.io.PrintStream;

View File

@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.lucene.codecs.idversion;
package org.apache.lucene.sandbox.codecs.idversion;
import java.io.IOException;

View File

@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.lucene.codecs.idversion;
package org.apache.lucene.sandbox.codecs.idversion;
import org.apache.lucene.codecs.BlockTermState;
import org.apache.lucene.index.TermState;

View File

@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.lucene.codecs.idversion;
package org.apache.lucene.sandbox.codecs.idversion;
import java.io.IOException;

View File

@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.lucene.codecs.idversion;
package org.apache.lucene.sandbox.codecs.idversion;
import org.apache.lucene.index.PostingsEnum;
import org.apache.lucene.util.BytesRef;

View File

@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.lucene.codecs.idversion;
package org.apache.lucene.sandbox.codecs.idversion;
import java.io.IOException;
import java.util.ArrayList;

View File

@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.lucene.codecs.idversion;
package org.apache.lucene.sandbox.codecs.idversion;
import java.io.IOException;
import java.util.ArrayList;

View File

@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.lucene.codecs.idversion;
package org.apache.lucene.sandbox.codecs.idversion;
import java.io.IOException;
import java.util.Collection;

View File

@ -19,4 +19,4 @@
* A primary-key postings format that associates a version (long) with each term and
* can provide fail-fast lookups by ID and version.
*/
package org.apache.lucene.codecs.idversion;
package org.apache.lucene.sandbox.codecs.idversion;

View File

@ -14,11 +14,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.lucene.document;
package org.apache.lucene.sandbox.document;
import java.math.BigInteger;
import java.util.Arrays;
import org.apache.lucene.document.Field;
import org.apache.lucene.document.FieldType;
import org.apache.lucene.index.PointValues;
import org.apache.lucene.search.PointInSetQuery;
import org.apache.lucene.search.PointRangeQuery;

View File

@ -15,9 +15,9 @@
* limitations under the License.
*/
package org.apache.lucene.document;
package org.apache.lucene.sandbox.document;
import org.apache.lucene.search.MultiRangeQuery;
import org.apache.lucene.sandbox.search.MultiRangeQuery;
import static org.apache.lucene.document.DoublePoint.decodeDimension;
import static org.apache.lucene.document.DoublePoint.pack;

View File

@ -15,9 +15,9 @@
* limitations under the License.
*/
package org.apache.lucene.document;
package org.apache.lucene.sandbox.document;
import org.apache.lucene.search.MultiRangeQuery;
import org.apache.lucene.sandbox.search.MultiRangeQuery;
import static org.apache.lucene.document.FloatPoint.decodeDimension;
import static org.apache.lucene.document.FloatPoint.pack;

View File

@ -15,13 +15,14 @@
* limitations under the License.
*/
package org.apache.lucene.document;
package org.apache.lucene.sandbox.document;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.PriorityQueue;
import org.apache.lucene.document.FloatPoint;
import org.apache.lucene.index.LeafReaderContext;
import org.apache.lucene.index.PointValues;
import org.apache.lucene.search.FieldDoc;

View File

@ -14,11 +14,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.lucene.document;
package org.apache.lucene.sandbox.document;
import java.util.Arrays;
import java.util.Collection;
import org.apache.lucene.document.Field;
import org.apache.lucene.document.FieldType;
import org.apache.lucene.document.NumericDocValuesField;
import org.apache.lucene.document.StoredField;
import org.apache.lucene.index.PointValues;
import org.apache.lucene.search.PointInSetQuery;
import org.apache.lucene.search.PointRangeQuery;

View File

@ -15,9 +15,9 @@
* limitations under the License.
*/
package org.apache.lucene.document;
package org.apache.lucene.sandbox.document;
import org.apache.lucene.search.MultiRangeQuery;
import org.apache.lucene.sandbox.search.MultiRangeQuery;
import static org.apache.lucene.document.IntPoint.decodeDimension;
import static org.apache.lucene.document.IntPoint.pack;

View File

@ -14,8 +14,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.lucene.document;
package org.apache.lucene.sandbox.document;
import org.apache.lucene.document.Field;
import org.apache.lucene.document.FieldType;
import org.apache.lucene.document.LatLonPoint;
import org.apache.lucene.document.RangeFieldQuery;
import org.apache.lucene.search.Query;
import org.apache.lucene.util.BytesRef;
import org.apache.lucene.util.NumericUtils;

View File

@ -15,9 +15,9 @@
* limitations under the License.
*/
package org.apache.lucene.document;
package org.apache.lucene.sandbox.document;
import org.apache.lucene.search.MultiRangeQuery;
import org.apache.lucene.sandbox.search.MultiRangeQuery;
import static org.apache.lucene.document.LongPoint.decodeDimension;
import static org.apache.lucene.document.LongPoint.pack;

View File

@ -25,7 +25,7 @@
<body>
This package contains several point types:
<ul>
<li>{@link org.apache.lucene.document.BigIntegerPoint BigIntegerPoint} for 128-bit integers</li>
<li>{@link org.apache.lucene.sandbox.document.BigIntegerPoint BigIntegerPoint} for 128-bit integers</li>
<li>{@link org.apache.lucene.document.LatLonPoint LatLonPoint} for latitude/longitude geospatial points</li>
</ul>
</body>

View File

@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.lucene.search;
package org.apache.lucene.sandbox.search;
import java.io.IOException;
import java.util.ArrayList;
@ -34,6 +34,26 @@ import org.apache.lucene.index.Term;
import org.apache.lucene.index.TermState;
import org.apache.lucene.index.TermStates;
import org.apache.lucene.index.TermsEnum;
import org.apache.lucene.search.BooleanClause;
import org.apache.lucene.search.BooleanQuery;
import org.apache.lucene.search.CollectionStatistics;
import org.apache.lucene.search.DisiPriorityQueue;
import org.apache.lucene.search.DisiWrapper;
import org.apache.lucene.search.DisjunctionDISIApproximation;
import org.apache.lucene.search.DocIdSetIterator;
import org.apache.lucene.search.Explanation;
import org.apache.lucene.search.IndexSearcher;
import org.apache.lucene.search.LeafSimScorer;
import org.apache.lucene.search.Matches;
import org.apache.lucene.search.Query;
import org.apache.lucene.search.QueryVisitor;
import org.apache.lucene.search.ScoreMode;
import org.apache.lucene.search.Scorer;
import org.apache.lucene.search.SynonymQuery;
import org.apache.lucene.search.TermQuery;
import org.apache.lucene.search.TermScorer;
import org.apache.lucene.search.TermStatistics;
import org.apache.lucene.search.Weight;
import org.apache.lucene.search.similarities.BM25Similarity;
import org.apache.lucene.search.similarities.Similarity;
import org.apache.lucene.search.similarities.SimilarityBase;

View File

@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.lucene.search;
package org.apache.lucene.sandbox.search;
import java.io.IOException;
import java.util.ArrayList;
@ -25,6 +25,19 @@ import java.util.stream.Collectors;
import org.apache.lucene.index.IndexReader;
import org.apache.lucene.index.LeafReaderContext;
import org.apache.lucene.search.BooleanClause;
import org.apache.lucene.search.Explanation;
import org.apache.lucene.search.IndexSearcher;
import org.apache.lucene.search.LongValues;
import org.apache.lucene.search.LongValuesSource;
import org.apache.lucene.search.Matches;
import org.apache.lucene.search.MatchesUtils;
import org.apache.lucene.search.Multiset;
import org.apache.lucene.search.Query;
import org.apache.lucene.search.QueryVisitor;
import org.apache.lucene.search.ScoreMode;
import org.apache.lucene.search.Scorer;
import org.apache.lucene.search.Weight;
import org.apache.lucene.util.Accountable;
import org.apache.lucene.util.RamUsageEstimator;

View File

@ -14,7 +14,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.lucene.search;
package org.apache.lucene.sandbox.search;
import org.apache.lucene.search.DisiPriorityQueue;
import org.apache.lucene.search.DisiWrapper;
import org.apache.lucene.search.DocIdSetIterator;
import org.apache.lucene.search.LongValues;
import org.apache.lucene.search.Scorer;
import org.apache.lucene.search.TwoPhaseIterator;
import org.apache.lucene.search.Weight;
import java.io.IOException;
import java.util.ArrayList;

View File

@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.lucene.search;
package org.apache.lucene.sandbox.search;
import java.io.IOException;
import java.util.Arrays;
@ -28,6 +28,15 @@ import org.apache.lucene.document.SortedNumericDocValuesField;
import org.apache.lucene.index.DocValues;
import org.apache.lucene.index.LeafReaderContext;
import org.apache.lucene.index.SortedNumericDocValues;
import org.apache.lucene.search.ConstantScoreScorer;
import org.apache.lucene.search.ConstantScoreWeight;
import org.apache.lucene.search.IndexSearcher;
import org.apache.lucene.search.Query;
import org.apache.lucene.search.QueryVisitor;
import org.apache.lucene.search.ScoreMode;
import org.apache.lucene.search.Scorer;
import org.apache.lucene.search.TwoPhaseIterator;
import org.apache.lucene.search.Weight;
import org.apache.lucene.util.Accountable;
import org.apache.lucene.util.RamUsageEstimator;

View File

@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.lucene.search;
package org.apache.lucene.sandbox.search;
import java.io.IOException;
import java.util.AbstractList;
@ -29,6 +29,15 @@ import org.apache.lucene.index.PrefixCodedTerms;
import org.apache.lucene.index.PrefixCodedTerms.TermIterator;
import org.apache.lucene.index.SortedSetDocValues;
import org.apache.lucene.index.Term;
import org.apache.lucene.search.ConstantScoreScorer;
import org.apache.lucene.search.ConstantScoreWeight;
import org.apache.lucene.search.IndexSearcher;
import org.apache.lucene.search.Query;
import org.apache.lucene.search.QueryVisitor;
import org.apache.lucene.search.ScoreMode;
import org.apache.lucene.search.Scorer;
import org.apache.lucene.search.TwoPhaseIterator;
import org.apache.lucene.search.Weight;
import org.apache.lucene.util.Accountable;
import org.apache.lucene.util.ArrayUtil;
import org.apache.lucene.util.BytesRef;

View File

@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.lucene.search;
package org.apache.lucene.sandbox.search;
import java.io.IOException;
import java.util.Objects;
@ -24,6 +24,20 @@ import org.apache.lucene.index.IndexReader;
import org.apache.lucene.index.LeafReaderContext;
import org.apache.lucene.index.NumericDocValues;
import org.apache.lucene.index.SortedNumericDocValues;
import org.apache.lucene.search.ConstantScoreScorer;
import org.apache.lucene.search.ConstantScoreWeight;
import org.apache.lucene.search.DocIdSetIterator;
import org.apache.lucene.search.DocValuesFieldExistsQuery;
import org.apache.lucene.search.FieldComparator;
import org.apache.lucene.search.IndexSearcher;
import org.apache.lucene.search.LeafFieldComparator;
import org.apache.lucene.search.Query;
import org.apache.lucene.search.QueryVisitor;
import org.apache.lucene.search.ScoreMode;
import org.apache.lucene.search.Scorer;
import org.apache.lucene.search.Sort;
import org.apache.lucene.search.SortField;
import org.apache.lucene.search.Weight;
/**
* A range query that can take advantage of the fact that the index is sorted to speed up

View File

@ -15,7 +15,7 @@
* limitations under the License.
*/
package org.apache.lucene.search;
package org.apache.lucene.sandbox.search;
import java.io.IOException;
import java.util.ArrayList;
@ -24,6 +24,15 @@ import java.util.Comparator;
import java.util.List;
import org.apache.lucene.index.LeafReaderContext;
import org.apache.lucene.search.Collector;
import org.apache.lucene.search.HitQueue;
import org.apache.lucene.search.LeafCollector;
import org.apache.lucene.search.Scorable;
import org.apache.lucene.search.ScoreDoc;
import org.apache.lucene.search.ScoreMode;
import org.apache.lucene.search.TopDocs;
import org.apache.lucene.search.TopScoreDocCollector;
import org.apache.lucene.search.TotalHits;
import static org.apache.lucene.search.TopDocsCollector.EMPTY_TOPDOCS;

View File

@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.lucene.search;
package org.apache.lucene.sandbox.search;
import java.io.IOException;
import java.util.ArrayList;
@ -26,6 +26,12 @@ import org.apache.lucene.document.LatLonPoint;
import org.apache.lucene.geo.GeoUtils;
import org.apache.lucene.index.LeafReaderContext;
import org.apache.lucene.index.PointValues;
import org.apache.lucene.search.FieldDoc;
import org.apache.lucene.search.IndexSearcher;
import org.apache.lucene.search.MatchAllDocsQuery;
import org.apache.lucene.search.ScoreDoc;
import org.apache.lucene.search.TopFieldDocs;
import org.apache.lucene.search.TotalHits;
import org.apache.lucene.util.Bits;
import org.apache.lucene.util.SloppyMath;
import org.apache.lucene.util.bkd.BKDReader;

View File

@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.lucene.search;
package org.apache.lucene.sandbox.search;
import java.util.AbstractSet;
import java.util.Arrays;

View File

@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.lucene.search;
package org.apache.lucene.sandbox.search;
import java.io.IOException;
import java.util.ArrayList;
@ -24,10 +24,12 @@ import java.util.Objects;
import org.apache.lucene.index.LeafReader;
import org.apache.lucene.index.NumericDocValues;
import org.apache.lucene.search.Explanation;
import org.apache.lucene.search.LeafSimScorer;
import org.apache.lucene.search.similarities.Similarity.SimScorer;
import org.apache.lucene.util.SmallFloat;
import static org.apache.lucene.search.BM25FQuery.FieldAndWeight;
import static org.apache.lucene.sandbox.search.BM25FQuery.FieldAndWeight;
/**
* Copy of {@link LeafSimScorer} that sums document's norms from multiple fields.

View File

@ -15,7 +15,7 @@
* limitations under the License.
*/
package org.apache.lucene.search;
package org.apache.lucene.sandbox.search;
import java.io.IOException;
import java.util.ArrayList;
@ -26,6 +26,16 @@ import java.util.Objects;
import org.apache.lucene.index.LeafReader;
import org.apache.lucene.index.LeafReaderContext;
import org.apache.lucene.index.PointValues;
import org.apache.lucene.search.ConstantScoreScorer;
import org.apache.lucene.search.ConstantScoreWeight;
import org.apache.lucene.search.DocIdSetIterator;
import org.apache.lucene.search.IndexSearcher;
import org.apache.lucene.search.Query;
import org.apache.lucene.search.QueryVisitor;
import org.apache.lucene.search.ScoreMode;
import org.apache.lucene.search.Scorer;
import org.apache.lucene.search.ScorerSupplier;
import org.apache.lucene.search.Weight;
import org.apache.lucene.util.ArrayUtil;
import org.apache.lucene.util.DocIdSetBuilder;

View File

@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.lucene.search;
package org.apache.lucene.sandbox.search;
import java.io.IOException;
import java.util.ArrayList;

View File

@ -15,7 +15,7 @@
* limitations under the License.
*/
package org.apache.lucene.search;
package org.apache.lucene.sandbox.search;
import java.io.IOException;
import java.util.ArrayList;
@ -36,6 +36,24 @@ import org.apache.lucene.index.TermState;
import org.apache.lucene.index.TermStates;
import org.apache.lucene.index.Terms;
import org.apache.lucene.index.TermsEnum;
import org.apache.lucene.search.BooleanClause;
import org.apache.lucene.search.ConstantScoreWeight;
import org.apache.lucene.search.ExactPhraseMatcher;
import org.apache.lucene.search.IndexSearcher;
import org.apache.lucene.search.MatchNoDocsQuery;
import org.apache.lucene.search.MultiPhraseQuery;
import org.apache.lucene.search.MultiTermQuery;
import org.apache.lucene.search.PhraseMatcher;
import org.apache.lucene.search.PhraseQuery;
import org.apache.lucene.search.PhraseWeight;
import org.apache.lucene.search.Query;
import org.apache.lucene.search.QueryVisitor;
import org.apache.lucene.search.ScoreMode;
import org.apache.lucene.search.Scorer;
import org.apache.lucene.search.SloppyPhraseMatcher;
import org.apache.lucene.search.TermQuery;
import org.apache.lucene.search.TermStatistics;
import org.apache.lucene.search.Weight;
import org.apache.lucene.search.similarities.Similarity;
import org.apache.lucene.util.ArrayUtil;
import org.apache.lucene.util.BytesRef;
@ -216,7 +234,7 @@ public class PhraseWildcardQuery extends Query {
}
PhraseWeight createPhraseWeight(IndexSearcher searcher, ScoreMode scoreMode,
float boost, TermsData termsData) throws IOException {
float boost, TermsData termsData) throws IOException {
return new PhraseWeight(this, field, searcher, scoreMode) {
@Override
@ -760,7 +778,7 @@ public class PhraseWildcardQuery extends Query {
@Override
protected void toString(StringBuilder builder) {
builder.append(query.toString(query.field));
builder.append(query.toString(query.getField()));
}
@Override

View File

@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.lucene.search;
package org.apache.lucene.sandbox.search;
import java.io.IOException;
import java.util.ArrayList;
@ -31,6 +31,20 @@ import org.apache.lucene.index.Term;
import org.apache.lucene.index.TermState;
import org.apache.lucene.index.TermStates;
import org.apache.lucene.index.TermsEnum;
import org.apache.lucene.search.BooleanClause;
import org.apache.lucene.search.Explanation;
import org.apache.lucene.search.IndexSearcher;
import org.apache.lucene.search.LeafSimScorer;
import org.apache.lucene.search.MatchNoDocsQuery;
import org.apache.lucene.search.MultiPhraseQuery;
import org.apache.lucene.search.PhraseQuery;
import org.apache.lucene.search.Query;
import org.apache.lucene.search.QueryVisitor;
import org.apache.lucene.search.ScoreMode;
import org.apache.lucene.search.Scorer;
import org.apache.lucene.search.TermQuery;
import org.apache.lucene.search.TermStatistics;
import org.apache.lucene.search.Weight;
import org.apache.lucene.search.similarities.Similarity;
import org.apache.lucene.search.spans.SpanNearQuery;
import org.apache.lucene.util.Accountable;

View File

@ -14,13 +14,16 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.lucene.search;
package org.apache.lucene.sandbox.search;
import java.io.IOException;
import java.util.Map;
import org.apache.lucene.search.TermAutomatonQuery.EnumAndScorer;
import org.apache.lucene.search.TermAutomatonQuery.TermAutomatonWeight;
import org.apache.lucene.sandbox.search.TermAutomatonQuery.EnumAndScorer;
import org.apache.lucene.sandbox.search.TermAutomatonQuery.TermAutomatonWeight;
import org.apache.lucene.search.DocIdSetIterator;
import org.apache.lucene.search.LeafSimScorer;
import org.apache.lucene.search.Scorer;
import org.apache.lucene.util.ArrayUtil;
import org.apache.lucene.util.BytesRef;
import org.apache.lucene.util.PriorityQueue;

View File

@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.lucene.search;
package org.apache.lucene.sandbox.search;
import java.io.IOException;
@ -23,6 +23,7 @@ import org.apache.lucene.analysis.tokenattributes.OffsetAttribute;
import org.apache.lucene.analysis.tokenattributes.PositionIncrementAttribute;
import org.apache.lucene.analysis.tokenattributes.PositionLengthAttribute;
import org.apache.lucene.analysis.tokenattributes.TermToBytesRefAttribute;
import org.apache.lucene.sandbox.search.TermAutomatonQuery;
import org.apache.lucene.util.BytesRef;
/** Consumes a TokenStream and creates an {@link TermAutomatonQuery}

View File

@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
org.apache.lucene.codecs.idversion.IDVersionPostingsFormat
org.apache.lucene.sandbox.codecs.idversion.IDVersionPostingsFormat

View File

@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.lucene.codecs.idversion;
package org.apache.lucene.sandbox.codecs.idversion;
import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.analysis.TokenStream;

View File

@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.lucene.codecs.idversion;
package org.apache.lucene.sandbox.codecs.idversion;
import java.io.IOException;
import java.util.ArrayList;
@ -32,7 +32,7 @@ import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.analysis.MockAnalyzer;
import org.apache.lucene.analysis.MockTokenFilter;
import org.apache.lucene.analysis.MockTokenizer;
import org.apache.lucene.codecs.idversion.StringAndPayloadField.SingleTokenWithPayloadTokenStream;
import org.apache.lucene.sandbox.codecs.idversion.StringAndPayloadField.SingleTokenWithPayloadTokenStream;
import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field;
import org.apache.lucene.document.FieldType;

View File

@ -14,12 +14,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.lucene.document;
package org.apache.lucene.sandbox.document;
import java.math.BigInteger;
import org.apache.lucene.document.Document;
import org.apache.lucene.index.IndexReader;
import org.apache.lucene.index.RandomIndexWriter;
import org.apache.lucene.sandbox.document.BigIntegerPoint;
import org.apache.lucene.search.IndexSearcher;
import org.apache.lucene.search.Query;
import org.apache.lucene.store.Directory;

View File

@ -14,8 +14,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.lucene.document;
package org.apache.lucene.sandbox.document;
import org.apache.lucene.document.Document;
import org.apache.lucene.document.DoubleRange;
import org.apache.lucene.util.LuceneTestCase;
/**

View File

@ -14,10 +14,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.lucene.document;
package org.apache.lucene.sandbox.document;
import java.util.Arrays;
import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field;
import org.apache.lucene.document.FloatPoint;
import org.apache.lucene.document.StoredField;
import org.apache.lucene.document.StringField;
import org.apache.lucene.index.DirectoryReader;
import org.apache.lucene.index.IndexWriter;
import org.apache.lucene.index.IndexWriterConfig;
@ -27,7 +32,7 @@ import org.apache.lucene.index.SerialMergeScheduler;
import org.apache.lucene.index.Term;
import org.apache.lucene.search.FieldDoc;
import org.apache.lucene.search.IndexSearcher;
import org.apache.lucene.search.LatLonPointPrototypeQueries;
import org.apache.lucene.sandbox.search.LatLonPointPrototypeQueries;
import org.apache.lucene.search.ScoreDoc;
import org.apache.lucene.store.Directory;
import org.apache.lucene.util.LuceneTestCase;
@ -51,7 +56,7 @@ public class TestFloatPointNearestNeighbor extends LuceneTestCase {
DirectoryReader r = w.getReader();
// can't wrap because we require Lucene60PointsFormat directly but e.g. ParallelReader wraps with its own points impl:
IndexSearcher s = newSearcher(r, false);
FieldDoc hit = (FieldDoc)FloatPointNearestNeighbor.nearest(s, "point", 1, 40.0f, 50.0f).scoreDocs[0];
FieldDoc hit = (FieldDoc) FloatPointNearestNeighbor.nearest(s, "point", 1, 40.0f, 50.0f).scoreDocs[0];
assertEquals("0", r.document(hit.doc).getField("id").stringValue());
r.close();

View File

@ -14,12 +14,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.lucene.document;
package org.apache.lucene.sandbox.document;
import java.util.Arrays;
import org.apache.lucene.document.Document;
import org.apache.lucene.index.IndexReader;
import org.apache.lucene.index.RandomIndexWriter;
import org.apache.lucene.sandbox.document.HalfFloatPoint;
import org.apache.lucene.search.IndexSearcher;
import org.apache.lucene.store.Directory;
import org.apache.lucene.util.ArrayUtil;

View File

@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.lucene.search;
package org.apache.lucene.sandbox.search;
import java.util.Arrays;
import java.util.HashSet;
@ -22,6 +22,7 @@ import java.util.Set;
import java.util.stream.Collectors;
import java.util.stream.LongStream;
import org.apache.lucene.sandbox.search.LongHashSet;
import org.apache.lucene.util.LuceneTestCase;
public class LongHashSetTests extends LuceneTestCase {

View File

@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.lucene.search;
package org.apache.lucene.sandbox.search;
import java.io.IOException;
@ -27,6 +27,16 @@ import org.apache.lucene.index.IndexReader;
import org.apache.lucene.index.MultiReader;
import org.apache.lucene.index.RandomIndexWriter;
import org.apache.lucene.index.Term;
import org.apache.lucene.sandbox.search.BM25FQuery;
import org.apache.lucene.search.CheckHits;
import org.apache.lucene.search.IndexSearcher;
import org.apache.lucene.search.MatchNoDocsQuery;
import org.apache.lucene.search.Query;
import org.apache.lucene.search.SynonymQuery;
import org.apache.lucene.search.TermQuery;
import org.apache.lucene.search.TopDocs;
import org.apache.lucene.search.TopScoreDocCollector;
import org.apache.lucene.search.TotalHits;
import org.apache.lucene.search.similarities.BM25Similarity;
import org.apache.lucene.store.Directory;
import org.apache.lucene.util.BytesRef;

View File

@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.lucene.search;
package org.apache.lucene.sandbox.search;
import java.io.IOException;
import java.util.ArrayList;
@ -31,7 +31,15 @@ import org.apache.lucene.index.IndexReader;
import org.apache.lucene.index.IndexWriter;
import org.apache.lucene.index.MultiReader;
import org.apache.lucene.index.Term;
import org.apache.lucene.sandbox.search.CoveringQuery;
import org.apache.lucene.search.BooleanClause.Occur;
import org.apache.lucene.search.BooleanQuery;
import org.apache.lucene.search.IndexSearcher;
import org.apache.lucene.search.LongValuesSource;
import org.apache.lucene.search.PhraseQuery;
import org.apache.lucene.search.Query;
import org.apache.lucene.search.QueryUtils;
import org.apache.lucene.search.TermQuery;
import org.apache.lucene.store.Directory;
import org.apache.lucene.util.LuceneTestCase;

View File

@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.lucene.search;
package org.apache.lucene.sandbox.search;
import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field.Store;
@ -24,7 +24,16 @@ import org.apache.lucene.document.StringField;
import org.apache.lucene.index.IndexReader;
import org.apache.lucene.index.RandomIndexWriter;
import org.apache.lucene.index.Term;
import org.apache.lucene.sandbox.search.DocValuesNumbersQuery;
import org.apache.lucene.search.BooleanClause.Occur;
import org.apache.lucene.search.BooleanQuery;
import org.apache.lucene.search.BoostQuery;
import org.apache.lucene.search.ConstantScoreQuery;
import org.apache.lucene.search.IndexSearcher;
import org.apache.lucene.search.Query;
import org.apache.lucene.search.Sort;
import org.apache.lucene.search.TermQuery;
import org.apache.lucene.search.TopDocs;
import org.apache.lucene.store.Directory;
import org.apache.lucene.util.IOUtils;
import org.apache.lucene.util.LuceneTestCase;

View File

@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.lucene.search;
package org.apache.lucene.sandbox.search;
import java.io.IOException;
import java.util.ArrayList;
@ -27,7 +27,16 @@ import org.apache.lucene.document.StringField;
import org.apache.lucene.index.IndexReader;
import org.apache.lucene.index.RandomIndexWriter;
import org.apache.lucene.index.Term;
import org.apache.lucene.sandbox.search.DocValuesTermsQuery;
import org.apache.lucene.search.BooleanClause.Occur;
import org.apache.lucene.search.BooleanQuery;
import org.apache.lucene.search.BoostQuery;
import org.apache.lucene.search.ConstantScoreQuery;
import org.apache.lucene.search.IndexSearcher;
import org.apache.lucene.search.Query;
import org.apache.lucene.search.Sort;
import org.apache.lucene.search.TermQuery;
import org.apache.lucene.search.TopDocs;
import org.apache.lucene.store.Directory;
import org.apache.lucene.util.BytesRef;
import org.apache.lucene.util.IOUtils;

View File

@ -14,10 +14,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.lucene.search;
package org.apache.lucene.sandbox.search;
import org.apache.lucene.document.Field;
import org.apache.lucene.document.SortedDocValuesField;
import org.apache.lucene.sandbox.search.DocValuesTermsQuery;
import org.apache.lucene.search.IndexSearcher;
import org.apache.lucene.search.ScoreDoc;
import org.apache.lucene.util.BytesRef;
import org.apache.lucene.util.LuceneTestCase;
import org.apache.lucene.document.Document;
@ -31,7 +34,7 @@ import java.util.List;
/**
* A basic unit test for FieldCacheTermsFilter
*
* @see org.apache.lucene.search.DocValuesTermsQuery
* @see DocValuesTermsQuery
*/
public class TestFieldCacheTermsFilter extends LuceneTestCase {
public void testMissingTerms() throws Exception {

View File

@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.lucene.search;
package org.apache.lucene.sandbox.search;
import java.io.IOException;
@ -28,6 +28,20 @@ import org.apache.lucene.index.IndexReader;
import org.apache.lucene.index.IndexWriterConfig;
import org.apache.lucene.index.LeafReaderContext;
import org.apache.lucene.index.RandomIndexWriter;
import org.apache.lucene.sandbox.search.IndexSortSortedNumericDocValuesRangeQuery;
import org.apache.lucene.search.BooleanQuery;
import org.apache.lucene.search.DocValuesFieldExistsQuery;
import org.apache.lucene.search.IndexSearcher;
import org.apache.lucene.search.MatchNoDocsQuery;
import org.apache.lucene.search.Query;
import org.apache.lucene.search.QueryUtils;
import org.apache.lucene.search.ScoreMode;
import org.apache.lucene.search.Scorer;
import org.apache.lucene.search.Sort;
import org.apache.lucene.search.SortField;
import org.apache.lucene.search.SortedNumericSortField;
import org.apache.lucene.search.TopDocs;
import org.apache.lucene.search.Weight;
import org.apache.lucene.store.Directory;
import org.apache.lucene.util.BytesRef;
import org.apache.lucene.util.LuceneTestCase;

View File

@ -15,7 +15,7 @@
* limitations under the License.
*/
package org.apache.lucene.search;
package org.apache.lucene.sandbox.search;
import java.io.IOException;
@ -24,6 +24,17 @@ import org.apache.lucene.document.Field;
import org.apache.lucene.index.IndexReader;
import org.apache.lucene.index.RandomIndexWriter;
import org.apache.lucene.index.Term;
import org.apache.lucene.sandbox.search.LargeNumHitsTopDocsCollector;
import org.apache.lucene.search.BooleanClause;
import org.apache.lucene.search.BooleanQuery;
import org.apache.lucene.search.CheckHits;
import org.apache.lucene.search.IndexSearcher;
import org.apache.lucene.search.MatchAllDocsQuery;
import org.apache.lucene.search.Query;
import org.apache.lucene.search.ScoreDoc;
import org.apache.lucene.search.TermQuery;
import org.apache.lucene.search.TopDocs;
import org.apache.lucene.search.TopScoreDocCollector;
import org.apache.lucene.store.Directory;
import org.apache.lucene.util.LuceneTestCase;
@ -77,7 +88,7 @@ public class TestLargeNumHitsTopDocsCollector extends LuceneTestCase {
searcher.search(testQuery, largeCollector);
searcher.search(testQuery, regularCollector);
assertEquals(largeCollector.totalHits, regularCollector.totalHits);
assertEquals(largeCollector.totalHits, regularCollector.getTotalHits());
IllegalArgumentException expected = expectThrows(IllegalArgumentException.class, () -> {
largeCollector.topDocs(350_000);
@ -94,7 +105,7 @@ public class TestLargeNumHitsTopDocsCollector extends LuceneTestCase {
searcher.search(testQuery, largeCollector);
searcher.search(testQuery, regularCollector);
assertEquals(largeCollector.totalHits, regularCollector.totalHits);
assertEquals(largeCollector.totalHits, regularCollector.getTotalHits());
assertEquals(largeCollector.pq, null);
assertEquals(largeCollector.pqTop, null);
@ -108,7 +119,7 @@ public class TestLargeNumHitsTopDocsCollector extends LuceneTestCase {
searcher.search(testQuery, largeCollector);
searcher.search(testQuery, regularCollector);
assertEquals(largeCollector.totalHits, regularCollector.totalHits);
assertEquals(largeCollector.totalHits, regularCollector.getTotalHits());
assertNotEquals(largeCollector.pq, null);
assertNotEquals(largeCollector.pqTop, null);
@ -122,7 +133,7 @@ public class TestLargeNumHitsTopDocsCollector extends LuceneTestCase {
searcher.search(testQuery, largeCollector);
searcher.search(testQuery, regularCollector);
assertEquals(largeCollector.totalHits, regularCollector.totalHits);
assertEquals(largeCollector.totalHits, regularCollector.getTotalHits());
assertEquals(largeCollector.pq, null);
assertEquals(largeCollector.pqTop, null);
@ -146,7 +157,7 @@ public class TestLargeNumHitsTopDocsCollector extends LuceneTestCase {
searcher.search(testQuery, largeCollector);
searcher.search(testQuery, regularCollector);
assertEquals(largeCollector.totalHits, regularCollector.totalHits);
assertEquals(largeCollector.totalHits, regularCollector.getTotalHits());
TopDocs firstTopDocs = largeCollector.topDocs();
TopDocs secondTopDocs = regularCollector.topDocs();

View File

@ -14,14 +14,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.lucene.search;
package org.apache.lucene.sandbox.search;
import org.apache.lucene.document.Document;
import org.apache.lucene.document.LatLonBoundingBox;
import org.apache.lucene.sandbox.document.LatLonBoundingBox;
import org.apache.lucene.geo.GeoTestUtil;
import org.apache.lucene.geo.Rectangle;
import org.apache.lucene.index.IndexReader;
import org.apache.lucene.index.RandomIndexWriter;
import org.apache.lucene.search.BaseRangeFieldQueryTestCase;
import org.apache.lucene.search.IndexSearcher;
import org.apache.lucene.search.Query;
import org.apache.lucene.store.Directory;
import static org.apache.lucene.geo.GeoEncodingUtils.decodeLatitude;

View File

@ -15,21 +15,23 @@
* limitations under the License.
*/
package org.apache.lucene.search;
package org.apache.lucene.sandbox.search;
import java.io.IOException;
import org.apache.lucene.document.Document;
import org.apache.lucene.document.DoublePoint;
import org.apache.lucene.document.DoublePointMultiRangeBuilder;
import org.apache.lucene.sandbox.document.DoublePointMultiRangeBuilder;
import org.apache.lucene.document.FloatPoint;
import org.apache.lucene.document.FloatPointMultiRangeBuilder;
import org.apache.lucene.sandbox.document.FloatPointMultiRangeBuilder;
import org.apache.lucene.document.IntPoint;
import org.apache.lucene.document.IntPointMultiRangeBuilder;
import org.apache.lucene.sandbox.document.IntPointMultiRangeBuilder;
import org.apache.lucene.document.LongPoint;
import org.apache.lucene.document.LongPointMultiRangeBuilder;
import org.apache.lucene.sandbox.document.LongPointMultiRangeBuilder;
import org.apache.lucene.index.IndexReader;
import org.apache.lucene.index.RandomIndexWriter;
import org.apache.lucene.search.IndexSearcher;
import org.apache.lucene.search.Query;
import org.apache.lucene.store.Directory;
import org.apache.lucene.util.LuceneTestCase;
import org.apache.lucene.util.TestUtil;

View File

@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.lucene.search;
package org.apache.lucene.sandbox.search;
import java.util.Arrays;
import java.util.Comparator;
@ -33,6 +33,13 @@ import org.apache.lucene.index.IndexWriterConfig;
import org.apache.lucene.index.RandomIndexWriter;
import org.apache.lucene.index.SerialMergeScheduler;
import org.apache.lucene.index.Term;
import org.apache.lucene.sandbox.search.LatLonPointPrototypeQueries;
import org.apache.lucene.search.FieldDoc;
import org.apache.lucene.search.IndexSearcher;
import org.apache.lucene.search.MatchAllDocsQuery;
import org.apache.lucene.search.ScoreDoc;
import org.apache.lucene.search.Sort;
import org.apache.lucene.search.TopFieldDocs;
import org.apache.lucene.store.Directory;
import org.apache.lucene.util.LuceneTestCase;
import org.apache.lucene.util.SloppyMath;

View File

@ -15,7 +15,7 @@
* limitations under the License.
*/
package org.apache.lucene.search;
package org.apache.lucene.sandbox.search;
import java.io.IOException;
import java.util.Arrays;
@ -32,6 +32,20 @@ import org.apache.lucene.index.RandomIndexWriter;
import org.apache.lucene.index.Term;
import org.apache.lucene.index.Terms;
import org.apache.lucene.index.TermsEnum;
import org.apache.lucene.sandbox.search.PhraseWildcardQuery;
import org.apache.lucene.search.BooleanClause;
import org.apache.lucene.search.BooleanQuery;
import org.apache.lucene.search.DisjunctionMaxQuery;
import org.apache.lucene.search.DocIdSetIterator;
import org.apache.lucene.search.Explanation;
import org.apache.lucene.search.IndexSearcher;
import org.apache.lucene.search.MultiPhraseQuery;
import org.apache.lucene.search.Query;
import org.apache.lucene.search.ScoreDoc;
import org.apache.lucene.search.ScoreMode;
import org.apache.lucene.search.Scorer;
import org.apache.lucene.search.Weight;
import org.apache.lucene.search.WildcardQuery;
import org.apache.lucene.search.spans.SpanMultiTermQueryWrapper;
import org.apache.lucene.search.spans.SpanNearQuery;
import org.apache.lucene.search.spans.SpanQuery;
@ -40,7 +54,7 @@ import org.apache.lucene.store.Directory;
import org.apache.lucene.util.BytesRef;
import org.apache.lucene.util.LuceneTestCase;
import static org.apache.lucene.search.PhraseWildcardQuery.TestCounters;
import static org.apache.lucene.sandbox.search.PhraseWildcardQuery.TestCounters;
/**
* Tests {@link PhraseWildcardQuery}.

View File

@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.lucene.search;
package org.apache.lucene.sandbox.search;
import java.io.IOException;
import java.util.ArrayList;
@ -43,7 +43,25 @@ import org.apache.lucene.index.IndexWriterConfig;
import org.apache.lucene.index.LeafReaderContext;
import org.apache.lucene.index.RandomIndexWriter;
import org.apache.lucene.index.Term;
import org.apache.lucene.sandbox.search.TermAutomatonQuery;
import org.apache.lucene.sandbox.search.TokenStreamToTermAutomatonQuery;
import org.apache.lucene.search.BooleanClause;
import org.apache.lucene.search.BooleanClause.Occur;
import org.apache.lucene.search.BooleanQuery;
import org.apache.lucene.search.ConstantScoreScorer;
import org.apache.lucene.search.ConstantScoreWeight;
import org.apache.lucene.search.IndexSearcher;
import org.apache.lucene.search.MatchNoDocsQuery;
import org.apache.lucene.search.MultiPhraseQuery;
import org.apache.lucene.search.PhraseQuery;
import org.apache.lucene.search.Query;
import org.apache.lucene.search.QueryVisitor;
import org.apache.lucene.search.ScoreDoc;
import org.apache.lucene.search.ScoreMode;
import org.apache.lucene.search.Scorer;
import org.apache.lucene.search.TermQuery;
import org.apache.lucene.search.TopDocs;
import org.apache.lucene.search.Weight;
import org.apache.lucene.store.Directory;
import org.apache.lucene.util.AttributeSource;
import org.apache.lucene.util.BitSetIterator;

View File

@ -27,6 +27,7 @@ import org.apache.lucene.index.LeafReaderContext;
import org.apache.lucene.index.PrefixCodedTerms;
import org.apache.lucene.index.SortedSetDocValues;
import org.apache.lucene.index.Term;
import org.apache.lucene.sandbox.search.DocValuesTermsQuery;
import org.apache.lucene.search.*;
import org.apache.lucene.util.ArrayUtil;
import org.apache.lucene.util.BytesRef;

View File

@ -27,7 +27,7 @@ import org.apache.lucene.index.SortedSetDocValues;
import org.apache.lucene.index.Term;
import org.apache.lucene.search.AutomatonQuery;
import org.apache.lucene.search.Collector;
import org.apache.lucene.search.DocValuesTermsQuery;
import org.apache.lucene.sandbox.search.DocValuesTermsQuery;
import org.apache.lucene.search.Query;
import org.apache.lucene.search.ScoreMode;
import org.apache.lucene.search.SimpleCollector;