Package org.apache.solr.search
Class Grouping.CommandFunc
java.lang.Object
org.apache.solr.search.Grouping.Command<org.apache.lucene.util.mutable.MutableValue>
org.apache.solr.search.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 Summary
FieldsFields inherited from class org.apache.solr.search.Grouping.Command
docsPerGroup, format, groupOffset, groupSort, key, main, numGroups, offset, totalCount, withinGroupSort -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.lucene.search.grouping.AllGroupHeadsCollector<?> Returns a collector that is able to return the most relevant document of all groups.protected org.apache.lucene.search.CollectorReturns one or moreCollectorinstances that are needed to perform the first pass search.protected org.apache.lucene.search.CollectorReturns zero or moreCollectorinstances that are needed to perform the second pass search.protected voidfinish()Performs any necessary post actions to prepare the response.intReturns the number of matches for thisCommand.protected IntegerReturns the number of groups found for thisCommand.protected voidprepare()Prepare thisCommandfor execution.Methods inherited from class org.apache.solr.search.Grouping.Command
addDocList, commonResponse, createSimpleResponse, getDocList, populateScoresIfNecessary
-
Field Details
-
groupBy
public org.apache.lucene.queries.function.ValueSource groupBy
-
-
Constructor Details
-
CommandFunc
public CommandFunc()
-
-
Method Details
-
prepare
Description copied from class:Grouping.CommandPrepare thisCommandfor execution.- Specified by:
preparein classGrouping.Command<org.apache.lucene.util.mutable.MutableValue>- Throws:
IOException- If I/O related errors occur
-
createFirstPassCollector
Description copied from class:Grouping.CommandReturns one or moreCollectorinstances that are needed to perform the first pass search. If multiple Collectors are returned then these wrapped in aMultiCollector.- Specified by:
createFirstPassCollectorin classGrouping.Command<org.apache.lucene.util.mutable.MutableValue>- Returns:
- one or more
Collectorinstances that are need to perform the first pass search - Throws:
IOException- If I/O related errors occur
-
createSecondPassCollector
Description copied from class:Grouping.CommandReturns zero or moreCollectorinstances that are needed to perform the second pass search. In the case when noCollectorinstances are creatednullis returned. If multiple Collectors are returned then these wrapped in aMultiCollector.- Overrides:
createSecondPassCollectorin classGrouping.Command<org.apache.lucene.util.mutable.MutableValue>- Returns:
- zero or more
Collectorinstances 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 IOExceptionDescription copied from class:Grouping.CommandReturns a collector that is able to return the most relevant document of all groups. Returnsnullif the command doesn't support this type of collector.- Overrides:
createAllGroupCollectorin classGrouping.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
Description copied from class:Grouping.CommandPerforms any necessary post actions to prepare the response.- Specified by:
finishin classGrouping.Command<org.apache.lucene.util.mutable.MutableValue>- Throws:
IOException- If I/O related errors occur
-
getMatches
public int getMatches()Description copied from class:Grouping.CommandReturns the number of matches for thisCommand.- Specified by:
getMatchesin classGrouping.Command<org.apache.lucene.util.mutable.MutableValue>- Returns:
- the number of matches for this
Command
-
getNumberOfGroups
Description copied from class:Grouping.CommandReturns the number of groups found for thisCommand. If the command doesn't support counting the groupsnullis returned.- Overrides:
getNumberOfGroupsin classGrouping.Command<org.apache.lucene.util.mutable.MutableValue>- Returns:
- the number of groups found for this
Command
-