Class GroupCommand
java.lang.Object
org.apache.solr.client.solrj.response.GroupCommand
- All Implemented Interfaces:
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.query only one group is present and ngroups is always null
.- Since:
- solr 3.4
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionGroupCommand(String name, int matches) Creates a GroupCommand instanceGroupCommand(String name, int matches, int nGroups) Creates a GroupCommand instance. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a group to this command.intReturns the total number of documents found for this command.getName()Returns the name of this command.Returns the total number of groups found for this command.Returns the groups to be displayed.
-
Constructor Details
-
GroupCommand
Creates a GroupCommand instance- Parameters:
name- The name of this commandmatches- The total number of documents found for this command
-
GroupCommand
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 Details
-
getName
Returns the name of this command. This can be the field, function or query grouped by.- Returns:
- the name of this command
-
add
Adds a group to this command.- Parameters:
group- A group to be added
-
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
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.
-