Class GroupCommand
- java.lang.Object
- 
- org.apache.solr.client.solrj.response.GroupCommand
 
- 
- All Implemented Interfaces:
- Serializable
 
 public class GroupCommand extends Object implements Serializable This class represents the result of a group command. This can be the result of the following parameter:- group.field
- group.func
- group.query
 - The name of this command. This can be the field, function or query grouped by.
- The total number of documents that have matched.
- The total number of groups that have matched.
- The groups to be displayed. Depending on the start and rows parameter.
 group.queryonly one group is present and ngroups is alwaysnull.- Since:
- solr 3.4
- See Also:
- Serialized Form
 
- 
- 
Constructor SummaryConstructors Constructor Description GroupCommand(String name, int matches)Creates a GroupCommand instanceGroupCommand(String name, int matches, int nGroups)Creates a GroupCommand instance.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(Group group)Adds a group to this command.intgetMatches()Returns the total number of documents found for this command.StringgetName()Returns the name of this command.IntegergetNGroups()Returns the total number of groups found for this command.List<Group>getValues()Returns the groups to be displayed.
 
- 
- 
- 
Constructor Detail- 
GroupCommandpublic GroupCommand(String name, int matches) Creates a GroupCommand instance- Parameters:
- name- The name of this command
- matches- The total number of documents found for this command
 
 - 
GroupCommandpublic GroupCommand(String name, int matches, int nGroups) Creates a GroupCommand instance.- Parameters:
- name- The name of this command
- matches- The total number of documents found for this command
- nGroups- The total number of groups found for this command.
 
 
- 
 - 
Method Detail- 
getNamepublic String getName() Returns the name of this command. This can be the field, function or query grouped by.- Returns:
- the name of this command
 
 - 
addpublic void add(Group group) Adds a group to this command.- Parameters:
- group- A group to be added
 
 - 
getValuespublic List<Group> getValues() Returns the groups to be displayed. The number of groups returned depend on thestartandrowsparameters.- Returns:
- the groups to be displayed.
 
 - 
getMatchespublic int getMatches() Returns the total number of documents found for this command.- Returns:
- the total number of documents found for this command.
 
 - 
getNGroupspublic Integer getNGroups() Returns the total number of groups found for this command. Returnsnullif thegroup.ngroupsparameter is unset orfalseor if this is a group command query (parameter =group.query).- Returns:
- the total number of groups found for this command.
 
 
- 
 
-