Returns true iff there is such an entry.
Behaves as if written:
boolean skipTo(int target) { do { if (!next()) return false; } while (target > doc()); return true; }
125126127128129130131132133134135
return new DocIdSetIterator(){ private int _doc = -1; @Override public int advance(int target) throws IOException { if (td.skipTo(target)){ _doc = td.doc(); } else{ td.close(); _doc= DocIdSetIterator.NO_MORE_DOCS;
166167168169170171172173174175176
if (aprioriTermDocs.skipTo(100)) { assertTrue(testTermDocs.skipTo(100)); assertEquals(aprioriTermDocs.freq(), testTermDocs.freq()); assertEquals(aprioriTermDocs.doc(), testTermDocs.doc()); } else { assertFalse(testTermDocs.skipTo(100)); } if (aprioriTermDocs.next()) { assertTrue(testTermDocs.next());
179180181182183184185186187188189
} else { assertFalse(testTermDocs.next()); } if (aprioriTermDocs.skipTo(110)) { assertTrue(testTermDocs.skipTo(110)); assertEquals(aprioriTermDocs.freq(), testTermDocs.freq()); assertEquals(aprioriTermDocs.doc(), testTermDocs.doc()); } else { assertFalse(testTermDocs.skipTo(110)); }
183184185186187188189190191192193
if (aprioriTermDocs.skipTo(110)) { assertTrue(testTermDocs.skipTo(110)); assertEquals(aprioriTermDocs.freq(), testTermDocs.freq()); assertEquals(aprioriTermDocs.doc(), testTermDocs.doc()); } else { assertFalse(testTermDocs.skipTo(110)); } if (aprioriTermDocs.skipTo(10)) { assertTrue(testTermDocs.skipTo(10)); assertEquals(aprioriTermDocs.freq(), testTermDocs.freq());
187188189190191192193194195196197
} else { assertFalse(testTermDocs.skipTo(110)); } if (aprioriTermDocs.skipTo(10)) { assertTrue(testTermDocs.skipTo(10)); assertEquals(aprioriTermDocs.freq(), testTermDocs.freq()); assertEquals(aprioriTermDocs.doc(), testTermDocs.doc()); } else { assertFalse(testTermDocs.skipTo(10)); }
191192193194195196197198199200201
if (aprioriTermDocs.skipTo(10)) { assertTrue(testTermDocs.skipTo(10)); assertEquals(aprioriTermDocs.freq(), testTermDocs.freq()); assertEquals(aprioriTermDocs.doc(), testTermDocs.doc()); } else { assertFalse(testTermDocs.skipTo(10)); } if (aprioriTermDocs.skipTo(210)) { assertTrue(testTermDocs.skipTo(210));
196197198199200201202203204205206
assertFalse(testTermDocs.skipTo(10)); } if (aprioriTermDocs.skipTo(210)) { assertTrue(testTermDocs.skipTo(210)); assertEquals(aprioriTermDocs.freq(), testTermDocs.freq()); assertEquals(aprioriTermDocs.doc(), testTermDocs.doc()); } else { assertFalse(testTermDocs.skipTo(210)); }
200201202203204205206207208209210
if (aprioriTermDocs.skipTo(210)) { assertTrue(testTermDocs.skipTo(210)); assertEquals(aprioriTermDocs.freq(), testTermDocs.freq()); assertEquals(aprioriTermDocs.doc(), testTermDocs.doc()); } else { assertFalse(testTermDocs.skipTo(210)); } aprioriTermDocs.close(); testTermDocs.close();
469470471472473474475476477478479
TermDocs aprioriTermDocsSeeker = aprioriReader.termDocs(aprioriTermEnum.term()); TermDocs testTermDocsSeeker = testReader.termDocs(testTermEnum.term()); while (aprioriTermDocsSeeker.next()) { assertTrue(testTermDocsSeeker.skipTo(aprioriTermDocsSeeker.doc())); assertEquals(aprioriTermDocsSeeker.doc(), testTermDocsSeeker.doc()); } aprioriTermDocsSeeker.close(); testTermDocsSeeker.close();
115116117118119120121122123124125
Explanation tfExplanation = new Explanation(); int tf = 0; TermDocs termDocs = reader.termDocs(term); if (termDocs != null) { try { if (termDocs.skipTo(doc) && termDocs.doc() == doc) { tf = termDocs.freq(); } } finally { termDocs.close(); }