Apache Lucene open-source search software
LUCENE-3967: nuke AtomicReader.termDocsEnum(termState) and termPositionsEnum(termState)
Robert Muir2d3f58b2e807
diff --git a/lucene/core/src/java/org/apache/lucene/index/AtomicReader.java b/lucene/core/src/java/org/apache/lucene/index/AtomicReader.javaindex fd4428c52fc..413e2ede1b0 100644--- a/lucene/core/src/java/org/apache/lucene/index/AtomicReader.java+++ b/lucene/core/src/java/org/apache/lucene/index/AtomicReader.java@@ -167,47 +167,6 @@ public abstract class AtomicReader extends IndexReader {}return null;}-- /**- * Returns {@link DocsEnum} for the specified field and- * {@link TermState}. This may return null, if either the field or the term- * does not exists or the {@link TermState} is invalid for the underlying- * implementation.*/- public final DocsEnum termDocsEnum(Bits liveDocs, String field, BytesRef term, TermState state, boolean needsFreqs) throws IOException {- assert state != null;- assert field != null;- final Fields fields = fields();- if (fields != null) {- final Terms terms = fields.terms(field);- if (terms != null) {- final TermsEnum termsEnum = terms.iterator(null);- termsEnum.seekExact(term, state);- return termsEnum.docs(liveDocs, null, needsFreqs);- }- }- return null;- }-- /**- * Returns {@link DocsAndPositionsEnum} for the specified field and- * {@link TermState}. This may return null, if either the field or the term- * does not exists, the {@link TermState} is invalid for the underlying- * implementation, or needsOffsets is true but offsets- * were not indexed for this field. */- public final DocsAndPositionsEnum termPositionsEnum(Bits liveDocs, String field, BytesRef term, TermState state, boolean needsOffsets) throws IOException {- assert state != null;- assert field != null;- final Fields fields = fields();- if (fields != null) {- final Terms terms = fields.terms(field);- if (terms != null) {- final TermsEnum termsEnum = terms.iterator(null);- termsEnum.seekExact(term, state);- return termsEnum.docsAndPositions(liveDocs, null, needsOffsets);- }- }- return null;- }/** Returns the number of unique terms (across all fields)* in this reader.diff --git a/lucene/core/src/java/org/apache/lucene/search/PhraseQuery.java b/lucene/core/src/java/org/apache/lucene/search/PhraseQuery.javaindex 2f2a45c9635..f96b23a3c50 100644--- a/lucene/core/src/java/org/apache/lucene/search/PhraseQuery.java+++ b/lucene/core/src/java/org/apache/lucene/search/PhraseQuery.java@@ -269,7 +269,7 @@ public class PhraseQuery extends Query {// PhraseQuery on a field that did not index// positions.if (postingsEnum == null) {- assert reader.termDocsEnum(liveDocs, t.field(), t.bytes(), state, false) != null: "termstate found but no term exists in reader";+ assert te.seekExact(t.bytes(), false) : "termstate found but no term exists in reader";// term does exist, but has no positionsthrow new IllegalStateException("field \"" + t.field() + "\" was indexed without position data; cannot run PhraseQuery (term=" + t.text() + ")");}