You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by rm...@apache.org on 2012/04/12 03:25:25 UTC
svn commit: r1325092 - in
/lucene/dev/trunk/lucene/core/src/java/org/apache/lucene:
index/AtomicReader.java search/PhraseQuery.java
Author: rmuir
Date: Thu Apr 12 01:25:24 2012
New Revision: 1325092
URL: http://svn.apache.org/viewvc?rev=1325092&view=rev
Log:
LUCENE-3967: nuke AtomicReader.termDocsEnum(termState) and termPositionsEnum(termState)
Modified:
lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/AtomicReader.java
lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/search/PhraseQuery.java
Modified: lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/AtomicReader.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/AtomicReader.java?rev=1325092&r1=1325091&r2=1325092&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/AtomicReader.java (original)
+++ lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/AtomicReader.java Thu Apr 12 01:25:24 2012
@@ -167,47 +167,6 @@ public abstract class AtomicReader exten
}
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.
Modified: lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/search/PhraseQuery.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/search/PhraseQuery.java?rev=1325092&r1=1325091&r2=1325092&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/search/PhraseQuery.java (original)
+++ lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/search/PhraseQuery.java Thu Apr 12 01:25:24 2012
@@ -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 positions
throw new IllegalStateException("field \"" + t.field() + "\" was indexed without position data; cannot run PhraseQuery (term=" + t.text() + ")");
}