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; }
7778798081828384858687
return docID; } @Override public int advance(int target) throws IOException { if (td.skipTo(target)) { docID = td.doc(); } else { docID = NO_MORE_DOCS; } return docID;
294295296297298299300301302303304
// filter out documents that do not match the name test if (nameTest != null) { TermDocs tDocs = reader.termDocs(new Term(FieldNames.LABEL, nameTest)); try { for (int i = hits.nextSetBit(0); i >= 0; i = hits.nextSetBit(i + 1)) { if (!tDocs.skipTo(i)) { hits.clear(i); } } } finally { tDocs.close();
548549550551552553554555556557558
return doc; } @Override public int advance(int target) throws IOException { if (!termDocs.skipTo(target)) return doc = NO_MORE_DOCS; while (!matchDoc(doc = termDocs.doc())) { if (!termDocs.next()) return doc = NO_MORE_DOCS; }
142143144145146147148149150151152
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(); }
136137138139140141142143144145146
assertEquals(aprioriTermDocs.next(), testTermDocs.next()); assertEquals(aprioriTermDocs.freq(), testTermDocs.freq()); assertEquals(aprioriTermDocs.doc(), testTermDocs.doc()); if (aprioriTermDocs.skipTo(4)) { assertTrue(testTermDocs.skipTo(4)); assertEquals(aprioriTermDocs.freq(), testTermDocs.freq()); assertEquals(aprioriTermDocs.doc(), testTermDocs.doc()); } else { assertFalse(testTermDocs.skipTo(4)); }
140141142143144145146147148149150
if (aprioriTermDocs.skipTo(4)) { assertTrue(testTermDocs.skipTo(4)); assertEquals(aprioriTermDocs.freq(), testTermDocs.freq()); assertEquals(aprioriTermDocs.doc(), testTermDocs.doc()); } else { assertFalse(testTermDocs.skipTo(4)); } if (aprioriTermDocs.next()) { assertTrue(testTermDocs.next()); assertEquals(aprioriTermDocs.freq(), testTermDocs.freq());
155156157158159160161162163164165
// beyond this point all next and skipto will return false if (aprioriTermDocs.skipTo(100)) { assertTrue(testTermDocs.skipTo(100)); assertEquals(aprioriTermDocs.freq(), testTermDocs.freq()); assertEquals(aprioriTermDocs.doc(), testTermDocs.doc()); } else { assertFalse(testTermDocs.skipTo(100)); }
159160161162163164165166167168169
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());
172173174175176177178179180181182
} 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)); }
176177178179180181182183184185186
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());