Class LuceneCollectors


  • public class LuceneCollectors
    extends Object
    • Method Detail

      • collectMatchingDocs

        public void collectMatchingDocs​(int offset,
                                        Integer limit)
                                 throws IOException
        Phase 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 an IOException.
      • 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 an IOException.
      • getTopDocs

        public org.apache.lucene.search.TopDocs getTopDocs()