Class Grouping.CommandField

  • Enclosing class:
    Grouping

    public class Grouping.CommandField
    extends Grouping.Command<org.apache.lucene.util.BytesRef>
    A group command for grouping on a field.
    • Field Detail

      • groupBy

        public String groupBy
    • Constructor Detail

      • CommandField

        public CommandField()
    • 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.BytesRef>
        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.BytesRef>
        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.BytesRef>
        Returns:
        a collector that is able to return the most relevant document of all groups.
        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.BytesRef>
        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.BytesRef>
        Returns:
        the number of groups found for this Command