Class GroupOptions

java.lang.Object
org.springframework.data.solr.core.query.GroupOptions

public class GroupOptions extends Object
Set of options that could be set for a Query in order to have grouped results.
Since:
1.4
  • Constructor Details

    • GroupOptions

      public GroupOptions()
  • Method Details

    • addGroupByField

      public GroupOptions addGroupByField(Field field)
      Adds a group request for a Field.
      Parameters:
      field -
      Returns:
    • getGroupByFields

      public List<Field> getGroupByFields()
      List of Fields to perform grouping by.
      Returns:
    • addGroupByField

      public GroupOptions addGroupByField(String fieldName)
      Adds a group request for a Field using its name.
      Parameters:
      fieldName -
      Returns:
    • addGroupByFunction

      public GroupOptions addGroupByFunction(Function function)
      Adds a group request for a Function result.
      Parameters:
      function -
      Returns:
    • getGroupByFunctions

      public List<Function> getGroupByFunctions()
      List of Functions to perform grouping by.
      Returns:
    • addGroupByQuery

      public GroupOptions addGroupByQuery(Query query)
      Adds a group request for a Query result.
      Parameters:
      query -
      Returns:
    • getGroupByQueries

      public List<Query> getGroupByQueries()
      List of Querys to perform grouping by.
      Returns:
    • setOffset

      public GroupOptions setOffset(@Nullable Integer offset)
      Sets the initial offset of each group.
      Parameters:
      offset -
      Returns:
    • getOffset

      @Nullable public Integer getOffset()
      Returns:
      initial offset of each group
    • getLimit

      @Nullable public Integer getLimit()
      Returns:
      the number of rows to return for each group.
    • setLimit

      public GroupOptions setLimit(Integer limit)
      Sets the number of rows to return for each group.
      Parameters:
      limit -
      Returns:
    • addSort

      public GroupOptions addSort(@Nullable org.springframework.data.domain.Sort sort)
      Adds Sort to 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

      public GroupOptions setTotalCount(boolean groupCount)
      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

      public GroupOptions setCachePercent(int cachePercent)
      Sets the caching for grouping results.
      Parameters:
      cachePercent -
      Returns:
    • getCachePercent

      public int getCachePercent()
      Returns:
      caching for grouping results.
    • setTruncateFacets

      public GroupOptions setTruncateFacets(boolean truncateFacets)
      Defines the maximum size of the group cache.
      Parameters:
      truncateFacets -
      Returns:
    • isTruncateFacets

      public boolean isTruncateFacets()
      Returns:
      the maximum size of the group cache.
    • setGroupFacets

      public GroupOptions setGroupFacets(boolean groupFacets)
      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

      public GroupOptions setGroupMain(boolean groupMain)
      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()