List of usage examples for org.apache.lucene.search CollectorManager newCollector
C newCollector() throws IOException;
From source file:com.lucene.MyIndexSearcher.java
License:Apache License
public <C extends Collector, T> T search(Query query, CollectorManager<C, T> collectorManager) throws IOException { final C collector = collectorManager.newCollector(); search(query, collector);/*from w w w .j a v a 2s .c o m*/ List<C> co = Collections.singletonList(collector); T coll = collectorManager.reduce(co); return coll; }