@Test public void collect() throws IOException { IndexSearcher searcher = new IndexSearcher(reader); Query query = new TermQuery(new Term("text", "text")); AllDocIdsCollector collector = new AllDocIdsCollector(); searcher.search(query, collector); BitSet docIds = collector.getDocIds(); assertEquals(3, docIds.cardinality()); for (int i = 0; i <= 2; i++) { assertTrue(docIds.get(i)); } }
@Override public void collect(int doc) { getDocIds().set(docBase + doc); }
AllDocIdsCollector extends AbstractDocIdsCollector { @Override public void collect(int doc) { getDocIds().set(docBase + doc); } }
AllDocIdsCollector extends AbstractDocIdsCollector { @Override public void collect(int doc) { getDocIds().set(docBase + doc); }  }
AllDocIdsCollector extends AbstractDocIdsCollector { @Override public void collect(int doc) { getDocIds().set(docBase + doc); }  @Override void setScorer(Scorer scorer); @Override void collect(int doc); @Override void setNextReader(AtomicReaderContext context); @Override boolean acceptsDocsOutOfOrder(); }
AllDocIdsCollector extends AbstractDocIdsCollector { @Override public void collect(int doc) { getDocIds().set(docBase + doc); }  @Override void setScorer(Scorer scorer); @Override void collect(int doc); @Override void setNextReader(AtomicReaderContext context); @Override boolean acceptsDocsOutOfOrder();  }