Class LuceneCollectors
- java.lang.Object
-
- org.hibernate.search.backend.lucene.search.extraction.impl.LuceneCollectors
-
public class LuceneCollectors extends Object
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcollectMatchingDocs(int offset, Integer limit)Phase 1: collect matching docs.<T> List<T>collectTopDocsData(TopDocsDataCollector.Factory<T> collectorFactory, int startInclusive, int endExclusive)Phase 2: collect data relative to top docs.CollectorSetgetCollectorsForAllMatchingDocs()SearchResultTotalgetResultTotal()org.apache.lucene.search.TopDocsgetTopDocs()
-
-
-
Method Detail
-
collectMatchingDocs
public void collectMatchingDocs(int offset, Integer limit) throws IOExceptionPhase 1: collect matching docs. Collects the total hit count, aggregations, and top docs.- Parameters:
offset- The index of the first collected top doc.limit- The maximum amount of top docs to collect.- Throws:
IOException- If Lucene throws anIOException.
-
getCollectorsForAllMatchingDocs
public CollectorSet getCollectorsForAllMatchingDocs()
-
collectTopDocsData
public <T> List<T> collectTopDocsData(TopDocsDataCollector.Factory<T> collectorFactory, int startInclusive, int endExclusive) throws IOException
Phase 2: collect data relative to top docs.- Type Parameters:
T- The type of value collected for each top doc.- Parameters:
collectorFactory- The factory to create a collector able to retrieve data for all top docs.startInclusive- The index of the first top doc whose data to collect.endExclusive- The index after the last top doc whose data to collect.- Throws:
IOException- If Lucene throws anIOException.
-
getResultTotal
public SearchResultTotal getResultTotal()
-
getTopDocs
public org.apache.lucene.search.TopDocs getTopDocs()
-
-