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 Summary
Constructors Constructor Description GroupCommand(String name, int matches)Creates a GroupCommand instanceGroupCommand(String name, int matches, int nGroups)Creates a GroupCommand instance.
-
Method Summary
All 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
-
GroupCommand
public GroupCommand(String name, int matches)
Creates a GroupCommand instance- Parameters:
name- The name of this commandmatches- The total number of documents found for this command
-
GroupCommand
public GroupCommand(String name, int matches, int nGroups)
Creates a GroupCommand instance.- Parameters:
name- The name of this commandmatches- The total number of documents found for this commandnGroups- The total number of groups found for this command.
-
-
Method Detail
-
getName
public String getName()
Returns the name of this command. This can be the field, function or query grouped by.- Returns:
- the name of this command
-
add
public void add(Group group)
Adds a group to this command.- Parameters:
group- A group to be added
-
getValues
public List<Group> getValues()
Returns the groups to be displayed. The number of groups returned depend on thestartandrowsparameters.- Returns:
- the groups to be displayed.
-
getMatches
public int getMatches()
Returns the total number of documents found for this command.- Returns:
- the total number of documents found for this command.
-
getNGroups
public 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.
-
-