Package org.apache.solr.search
Class Grouping.CommandField
- java.lang.Object
-
- org.apache.solr.search.Grouping.Command<org.apache.lucene.util.BytesRef>
-
- org.apache.solr.search.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 Summary
Fields Modifier and Type Field Description String
groupBy
-
Fields inherited from class org.apache.solr.search.Grouping.Command
docsPerGroup, format, groupOffset, groupSort, key, main, numGroups, offset, totalCount, withinGroupSort
-
-
Constructor Summary
Constructors Constructor Description CommandField()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.lucene.search.grouping.AllGroupHeadsCollector<?>
createAllGroupCollector()
Returns a collector that is able to return the most relevant document of all groups.protected org.apache.lucene.search.Collector
createFirstPassCollector()
Returns one or moreCollector
instances that are needed to perform the first pass search.protected org.apache.lucene.search.Collector
createSecondPassCollector()
Returns zero or moreCollector
instances that are needed to perform the second pass search.protected void
finish()
Performs any necessary post actions to prepare the response.int
getMatches()
Returns the number of matches for thisCommand
.protected Integer
getNumberOfGroups()
Returns the number of groups found for thisCommand
.protected void
prepare()
Prepare thisCommand
for execution.-
Methods inherited from class org.apache.solr.search.Grouping.Command
addDocList, commonResponse, createSimpleResponse, getDocList, populateScoresIfNecessary
-
-
-
-
Field Detail
-
groupBy
public String groupBy
-
-
Method Detail
-
prepare
protected void prepare() throws IOException
Description copied from class:Grouping.Command
Prepare thisCommand
for execution.- Specified by:
prepare
in classGrouping.Command<org.apache.lucene.util.BytesRef>
- Throws:
IOException
- If I/O related errors occur
-
createFirstPassCollector
protected org.apache.lucene.search.Collector createFirstPassCollector() throws IOException
Description copied from class:Grouping.Command
Returns one or moreCollector
instances that are needed to perform the first pass search. If multiple Collectors are returned then these wrapped in aMultiCollector
.- Specified by:
createFirstPassCollector
in classGrouping.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 moreCollector
instances that are needed to perform the second pass search. In the case when noCollector
instances are creatednull
is returned. If multiple Collectors are returned then these wrapped in aMultiCollector
.- Overrides:
createSecondPassCollector
in classGrouping.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. Returnsnull
if the command doesn't support this type of collector.- Overrides:
createAllGroupCollector
in classGrouping.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
-
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 classGrouping.Command<org.apache.lucene.util.BytesRef>
- Throws:
IOException
- If I/O related errors occur
-
getMatches
public int getMatches()
Description copied from class:Grouping.Command
Returns the number of matches for thisCommand
.- Specified by:
getMatches
in classGrouping.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 thisCommand
. If the command doesn't support counting the groupsnull
is returned.- Overrides:
getNumberOfGroups
in classGrouping.Command<org.apache.lucene.util.BytesRef>
- Returns:
- the number of groups found for this
Command
-
-