Class Grouping


  • public class Grouping
    extends Object
    Basic Solr Grouping infrastructure. Warning NOT thread safe!
    WARNING: This API is experimental and might change in incompatible ways in the next release.
    • Field Detail

      • mainResult

        public DocList mainResult
    • Constructor Detail

      • Grouping

        public Grouping​(SolrIndexSearcher searcher,
                        QueryResult qr,
                        QueryCommand cmd,
                        boolean cacheSecondPassSearch,
                        int maxDocsPercentageToCache,
                        boolean main)
        Parameters:
        cacheSecondPassSearch - Whether to cache the documents and scores from the first pass search for the second pass search.
        maxDocsPercentageToCache - The maximum number of documents in a percentage relative from maxdoc that is allowed in the cache. When this threshold is met, the cache is not used in the second pass search.
    • Method Detail

      • setGroupSort

        public Grouping setGroupSort​(org.apache.lucene.search.Sort groupSort)
      • setWithinGroupSort

        public Grouping setWithinGroupSort​(org.apache.lucene.search.Sort withinGroupSort)
      • setLimitDefault

        public Grouping setLimitDefault​(int limitDefault)
      • setDocsPerGroupDefault

        public Grouping setDocsPerGroupDefault​(int docsPerGroupDefault)
      • setGroupOffsetDefault

        public Grouping setGroupOffsetDefault​(int groupOffsetDefault)
      • setGetGroupedDocSet

        public Grouping setGetGroupedDocSet​(boolean getGroupedDocSet)
      • getMax

        public static int getMax​(int offset,
                                 int len,
                                 int max)
        Returns offset + len if len equals zero or higher. Otherwise returns max.
        Parameters:
        offset - The offset
        len - The number of documents to return
        max - The number of document to return if len < 0 or if offset + len > 0
        Returns:
        offset + len if len equals zero or higher. Otherwise returns max
      • isSignalCacheWarning

        public boolean isSignalCacheWarning()
        Returns whether a cache warning should be send to the client. The value true is returned when the cache is emptied because the caching limits where met, otherwise false is returned.
        Returns:
        whether a cache warning should be send to the client