Class TopScoreDocCollector

    • Method Detail

      • create

        public static TopScoreDocCollector create​(int numHits,
                                                  int totalHitsThreshold)
        Creates a new TopScoreDocCollector given the number of hits to collect and the number of hits to count accurately.

        NOTE: If the total hit count of the top docs is less than or exactly totalHitsThreshold then this value is accurate. On the other hand, if the TopDocs.totalHits value is greater than totalHitsThreshold then its value is a lower bound of the hit count. A value of Integer.MAX_VALUE will make the hit count accurate but will also likely make query processing slower.

        NOTE: The instances returned by this method pre-allocate a full array of length numHits, and fill the array with sentinel objects.

      • create

        public static TopScoreDocCollector create​(int numHits,
                                                  ScoreDoc after,
                                                  int totalHitsThreshold)
        Creates a new TopScoreDocCollector given the number of hits to collect, the bottom of the previous page, and the number of hits to count accurately.

        NOTE: If the total hit count of the top docs is less than or exactly totalHitsThreshold then this value is accurate. On the other hand, if the TopDocs.totalHits value is greater than totalHitsThreshold then its value is a lower bound of the hit count. A value of Integer.MAX_VALUE will make the hit count accurate but will also likely make query processing slower.

        NOTE: The instances returned by this method pre-allocate a full array of length numHits, and fill the array with sentinel objects.

      • newTopDocs

        protected TopDocs newTopDocs​(ScoreDoc[] results,
                                     int start)
        Description copied from class: TopDocsCollector
        Returns a TopDocs instance containing the given results. If results is null it means there are no results to return, either because there were 0 calls to collect() or because the arguments to topDocs were invalid.
        Overrides:
        newTopDocs in class TopDocsCollector<ScoreDoc>
      • scoreMode

        public ScoreMode scoreMode()
        Description copied from interface: Collector
        Indicates what features are required from the scorer.
      • updateGlobalMinCompetitiveScore

        protected void updateGlobalMinCompetitiveScore​(Scorable scorer)
                                                throws java.io.IOException
        Throws:
        java.io.IOException
      • updateMinCompetitiveScore

        protected void updateMinCompetitiveScore​(Scorable scorer)
                                          throws java.io.IOException
        Throws:
        java.io.IOException