Class GroupOptions
java.lang.Object
org.springframework.data.solr.core.query.GroupOptions
Set of options that could be set for a
Query in order to have grouped results.- Since:
- 1.4
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddGroupByField(String fieldName) Adds a group request for aFieldusing its name.addGroupByField(Field field) Adds a group request for aField.addGroupByFunction(Function function) Adds a group request for aFunctionresult.addGroupByQuery(Query query) Adds a group request for aQueryresult.addSort(org.springframework.data.domain.Sort sort) AddsSortto instruct how to sort elements within a single group.intList ofFields to perform grouping by.List ofFunctions to perform grouping by.List ofQuerys to perform grouping by.getLimit()org.springframework.data.domain.Pageableorg.springframework.data.domain.SortgetSort()booleanbooleanbooleanbooleansetCachePercent(int cachePercent) Sets the caching for grouping results.setGroupFacets(boolean groupFacets) Defines whether field facet shall be computed in grouped fashion.setGroupMain(boolean groupMain) Defines whether or not the first field group result shall be used as main result.Sets the number of rows to return for each group.Sets the initial offset of each group.setTotalCount(boolean groupCount) Defines whether the group count should be included in the response.setTruncateFacets(boolean truncateFacets) Defines the maximum size of the group cache.
-
Constructor Details
-
GroupOptions
public GroupOptions()
-
-
Method Details
-
addGroupByField
Adds a group request for aField.- Parameters:
field-- Returns:
-
getGroupByFields
List ofFields to perform grouping by.- Returns:
-
addGroupByField
Adds a group request for aFieldusing its name.- Parameters:
fieldName-- Returns:
-
addGroupByFunction
Adds a group request for aFunctionresult.- Parameters:
function-- Returns:
-
getGroupByFunctions
List ofFunctions to perform grouping by.- Returns:
-
addGroupByQuery
Adds a group request for aQueryresult.- Parameters:
query-- Returns:
-
getGroupByQueries
List ofQuerys to perform grouping by.- Returns:
-
setOffset
Sets the initial offset of each group.- Parameters:
offset-- Returns:
-
getOffset
- Returns:
- initial offset of each group
-
getLimit
- Returns:
- the number of rows to return for each group.
-
setLimit
Sets the number of rows to return for each group.- Parameters:
limit-- Returns:
-
addSort
AddsSortto instruct how to sort elements within a single group.- Parameters:
sort-- Returns:
-
getSort
@Nullable public org.springframework.data.domain.Sort getSort()- Returns:
- sort instruction on how to sort elements within a single group.
-
setTotalCount
Defines whether the group count should be included in the response.- Parameters:
groupCount-- Returns:
-
isTotalCount
public boolean isTotalCount()- Returns:
- whether the group count should be included in the response.
-
setCachePercent
Sets the caching for grouping results.- Parameters:
cachePercent-- Returns:
-
getCachePercent
public int getCachePercent()- Returns:
- caching for grouping results.
-
setTruncateFacets
Defines the maximum size of the group cache.- Parameters:
truncateFacets-- Returns:
-
isTruncateFacets
public boolean isTruncateFacets()- Returns:
- the maximum size of the group cache.
-
setGroupFacets
Defines whether field facet shall be computed in grouped fashion.- Parameters:
groupFacets-- Returns:
-
isGroupFacets
public boolean isGroupFacets()- Returns:
- whether field facet shall be computed in grouped fashion.
-
setGroupMain
Defines whether or not the first field group result shall be used as main result.- Parameters:
groupMain-- Returns:
-
isGroupMain
public boolean isGroupMain()- Returns:
- whether or not the first field group result shall be used as main result.
-
getPageRequest
@Nullable public org.springframework.data.domain.Pageable getPageRequest()
-