public class GroupingRequest extends Object
Query
. Use the
factory method newInstance(com.yahoo.search.Query)
to create a new instance of this, then create and set the
GroupingOperation
using setRootOperation(GroupingOperation)
. Once the search returns, access the
result Group
using the getResultGroup(Result)
method.Modifier and Type | Method and Description |
---|---|
List<Continuation> |
continuations()
Returns the list of
Continuation s of this request. |
GroupingRequest |
copy(Select parentOfCopy)
Returns a deep copy of this
|
int |
getRequestId()
Returns the id of this GroupingRequest.
|
static List<GroupingRequest> |
getRequests(Query query)
Deprecated.
use query.getSelect().getGrouping()
|
RootGroup |
getResultGroup(Result result)
Returns the root result
RootGroup that corresponds to this request. |
GroupingOperation |
getRootOperation()
Returns the root
GroupingOperation that defines this request. |
TimeZone |
getTimeZone()
Returns the
TimeZone used when resolving time expressions such as DayOfMonthFunction and HourOfDayFunction . |
static GroupingRequest |
newInstance(Query query)
Creates a new grouping request and adds it to the query.getSelect().getGrouping() list
|
GroupingRequest |
setResultGroup(RootGroup group)
Deprecated.
this is a noop
|
GroupingRequest |
setRootOperation(GroupingOperation root)
Sets the root
GroupingOperation that defines this request. |
GroupingRequest |
setTimeZone(TimeZone timeZone)
Sets the
TimeZone used when resolving time expressions such as DayOfMonthFunction and HourOfDayFunction . |
String |
toString() |
public GroupingRequest copy(Select parentOfCopy)
public int getRequestId()
RootGroup
of the final result, and
allows tracking of per-request meta data.public GroupingOperation getRootOperation()
GroupingOperation
that defines this request. As long as this remains unset, the request
is void.public GroupingRequest setRootOperation(GroupingOperation root)
GroupingOperation
that defines this request. As long as this remains unset, the request is
void.root
- the root operation to set.public TimeZone getTimeZone()
TimeZone
used when resolving time expressions such as DayOfMonthFunction
and HourOfDayFunction
.public GroupingRequest setTimeZone(TimeZone timeZone)
TimeZone
used when resolving time expressions such as DayOfMonthFunction
and HourOfDayFunction
.timeZone
- the time zone to set.public RootGroup getResultGroup(Result 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.result
- the search result that contains the root group.RootGroup
of this request, or null if not found.@Deprecated public GroupingRequest setResultGroup(RootGroup group)
RootGroup
of this request. This is used by the executing grouping searcher, and should
not be called by a requesting searcher.group
- the result to set.public List<Continuation> continuations()
Continuation
s of this request. This is used by the executing grouping searcher to
allow pagination of grouping results.public static GroupingRequest newInstance(Query query)
query
- the query to attach the request to.@Deprecated public static List<GroupingRequest> getRequests(Query query)
Query
. If no requests have been
attached to the Query
, this method returns an empty list.query
- the query whose requests to return.Copyright © 2018. All rights reserved.