Class GroupingRequest

    • Method Detail

      • getRequestId

        public int getRequestId()
        Returns the id of this GroupingRequest. This id is injected into the RootGroup of the final result, and allows tracking of per-request meta data.
        Returns:
        the id of this request, or -1 if it has been removed from the query select statement
      • getRootOperation

        public GroupingOperation getRootOperation()
        Returns the root GroupingOperation that defines this request. As long as this remains unset, the request is void.
        Returns:
        the root operation.
      • setRootOperation

        public GroupingRequest setRootOperation​(GroupingOperation root)
        Sets the root GroupingOperation that defines this request. As long as this remains unset, the request is void.
        Parameters:
        root - the root operation to set.
        Returns:
        this, to allow chaining.
      • getTimeZone

        public java.util.TimeZone getTimeZone()
        Returns the TimeZone used when resolving time expressions such as DayOfMonthFunction and HourOfDayFunction.
        Returns:
        the time zone in use.
      • setTimeZone

        public GroupingRequest setTimeZone​(java.util.TimeZone timeZone)
        Sets the TimeZone used when resolving time expressions such as DayOfMonthFunction and HourOfDayFunction.
        Parameters:
        timeZone - the time zone to set.
        Returns:
        this, to allow chaining.
      • getResultGroup

        public RootGroup getResultGroup​(Result result)
        Returns the root result RootGroup that corresponds to this request. This is not available until the search returns. Because searchers are allowed to modify both Result and Hit objects freely, this method requires that you pass it the current Result object as argument.
        Parameters:
        result - the search result that contains the root group.
        Returns:
        the result RootGroup of this request, or null if not found.
      • continuations

        public java.util.List<Continuation> continuations()
        Returns the list of Continuations of this request. This is used by the executing grouping searcher to allow pagination of grouping results.
        Returns:
        the list of Continuations.
      • newInstance

        public static GroupingRequest newInstance​(Query query)
        Creates a new grouping request and adds it to the query.getSelect().getGrouping() list
        Parameters:
        query - the query to attach the request to.
        Returns:
        The created request.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object