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; }
460461462463464465466467468469470
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();
285286287288289290291292293294295
// 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();
143144145146147148149150151152153
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)); }
147148149150151152153154155156157
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());
162163164165166167168169170171172
// 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)); }
125126127128129130131132133134135
TermDocs testTermDocs = testReader.termDocs(aprioriTermEnum.term()); assertEquals(aprioriTermDocs.next(), testTermDocs.next()); assertEquals(aprioriTermDocs.doc(), testTermDocs.doc()); assertEquals(aprioriTermDocs.skipTo(100), testTermDocs.skipTo(100)); assertEquals(aprioriTermDocs.doc(), testTermDocs.doc()); assertEquals(aprioriTermDocs.next(), testTermDocs.next()); assertEquals(aprioriTermDocs.doc(), testTermDocs.doc());
134135136137138139140141142143144
assertEquals(aprioriTermDocs.doc(), testTermDocs.doc()); assertEquals(aprioriTermDocs.next(), testTermDocs.next()); assertEquals(aprioriTermDocs.doc(), testTermDocs.doc()); assertEquals(aprioriTermDocs.skipTo(110), testTermDocs.skipTo(110)); assertEquals(aprioriTermDocs.doc(), testTermDocs.doc()); assertEquals(aprioriTermDocs.skipTo(10), testTermDocs.skipTo(10)); assertEquals(aprioriTermDocs.doc(), testTermDocs.doc());
137138139140141142143144145146147
assertEquals(aprioriTermDocs.doc(), testTermDocs.doc()); assertEquals(aprioriTermDocs.skipTo(110), testTermDocs.skipTo(110)); assertEquals(aprioriTermDocs.doc(), testTermDocs.doc()); assertEquals(aprioriTermDocs.skipTo(10), testTermDocs.skipTo(10)); assertEquals(aprioriTermDocs.doc(), testTermDocs.doc()); assertEquals(aprioriTermDocs.skipTo(210), testTermDocs.skipTo(210)); assertEquals(aprioriTermDocs.doc(), testTermDocs.doc());
140141142143144145146147148149150
assertEquals(aprioriTermDocs.doc(), testTermDocs.doc()); assertEquals(aprioriTermDocs.skipTo(10), testTermDocs.skipTo(10)); assertEquals(aprioriTermDocs.doc(), testTermDocs.doc()); assertEquals(aprioriTermDocs.skipTo(210), testTermDocs.skipTo(210)); assertEquals(aprioriTermDocs.doc(), testTermDocs.doc()); aprioriTermDocs.close(); aprioriReader.close();
320321322323324325326327328329330