Class Grouping.CommandFunc

  • Enclosing class:
    Grouping

    public class Grouping.CommandFunc
    extends Grouping.Command<org.apache.lucene.util.mutable.MutableValue>
    A command for grouping on a function.
    • Field Detail

      • groupBy

        public org.apache.lucene.queries.function.ValueSource groupBy
    • Constructor Detail

      • CommandFunc

        public CommandFunc()
    • Method Detail

      • createFirstPassCollector

        protected org.apache.lucene.search.Collector createFirstPassCollector()
                                                                       throws IOException
        Description copied from class: Grouping.Command
        Returns one or more Collector instances that are needed to perform the first pass search. If multiple Collectors are returned then these wrapped in a MultiCollector.
        Specified by:
        createFirstPassCollector in class Grouping.Command<org.apache.lucene.util.mutable.MutableValue>
        Returns:
        one or more Collector instances that are need to perform the first pass search
        Throws:
        IOException - If I/O related errors occur
      • createSecondPassCollector

        protected org.apache.lucene.search.Collector createSecondPassCollector()
                                                                        throws IOException
        Description copied from class: Grouping.Command
        Returns zero or more Collector instances that are needed to perform the second pass search. In the case when no Collector instances are created null is returned. If multiple Collectors are returned then these wrapped in a MultiCollector.
        Overrides:
        createSecondPassCollector in class Grouping.Command<org.apache.lucene.util.mutable.MutableValue>
        Returns:
        zero or more Collector instances that are needed to perform the second pass search
        Throws:
        IOException - If I/O related errors occur
      • createAllGroupCollector

        public org.apache.lucene.search.grouping.AllGroupHeadsCollector<?> createAllGroupCollector()
                                                                                            throws IOException
        Description copied from class: Grouping.Command
        Returns a collector that is able to return the most relevant document of all groups. Returns null if the command doesn't support this type of collector.
        Overrides:
        createAllGroupCollector in class Grouping.Command<org.apache.lucene.util.mutable.MutableValue>
        Returns:
        a collector that is able to return the most relevant document of all groups.
        Throws:
        IOException - If I/O related errors occur
      • finish

        protected void finish()
                       throws IOException
        Description copied from class: Grouping.Command
        Performs any necessary post actions to prepare the response.
        Specified by:
        finish in class Grouping.Command<org.apache.lucene.util.mutable.MutableValue>
        Throws:
        IOException - If I/O related errors occur
      • getMatches

        public int getMatches()
        Description copied from class: Grouping.Command
        Returns the number of matches for this Command.
        Specified by:
        getMatches in class Grouping.Command<org.apache.lucene.util.mutable.MutableValue>
        Returns:
        the number of matches for this Command
      • getNumberOfGroups

        protected Integer getNumberOfGroups()
        Description copied from class: Grouping.Command
        Returns the number of groups found for this Command. If the command doesn't support counting the groups null is returned.
        Overrides:
        getNumberOfGroups in class Grouping.Command<org.apache.lucene.util.mutable.MutableValue>
        Returns:
        the number of groups found for this Command