if (fieldId == -1) throw new IOException("Unknown field " + field); postingList = new FieldOnlyIterablePosting(postingList, fieldId);
if (fieldId == -1) throw new IOException("Unknown field " + field); postingList = new FieldOnlyIterablePosting(postingList, fieldId);
@Test public void doTest() throws Exception { ArrayOfFieldIterablePosting fips = getFips(); IterablePosting ip1 = new FieldOnlyIterablePosting(fips, 0); assertEquals(1, ip1.next()); assertEquals(1, ip1.getFrequency()); assertEquals(2, ip1.getDocumentLength()); assertEquals(2, ip1.next()); assertEquals(8, ip1.getFrequency()); assertEquals(3, ip1.getDocumentLength()); assertEquals(IterablePosting.EOL, ip1.next()); assertEquals(IterablePosting.EOL, ip1.getId()); ip1.close(); }