Package stroom.query.api.v2
Class SearchRequest
- java.lang.Object
-
- stroom.query.api.v2.SearchRequest
-
- All Implemented Interfaces:
java.io.Serializable
public final class SearchRequest extends java.lang.Object implements java.io.Serializable
A class for describing a search request including the query to run and definition(s) of how the results should be returned- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SearchRequest.Builder
Builder for constructing aSearchRequest
-
Constructor Summary
Constructors Constructor Description SearchRequest()
SearchRequest(QueryKey key, Query query, java.util.List<ResultRequest> resultRequests, java.lang.String dateTimeLocale, java.lang.Boolean incremental)
SearchRequest(QueryKey key, Query query, java.util.List<ResultRequest> resultRequests, java.lang.String dateTimeLocale, java.lang.Boolean incremental, java.lang.Long timeout)
-
Method Summary
Modifier and Type Method Description boolean
equals(java.lang.Object o)
java.lang.String
getDateTimeLocale()
java.lang.Boolean
getIncremental()
QueryKey
getKey()
Query
getQuery()
java.util.List<ResultRequest>
getResultRequests()
java.lang.Long
getTimeout()
int
hashCode()
boolean
incremental()
void
setDateTimeLocale(java.lang.String dateTimeLocale)
void
setIncremental(java.lang.Boolean incremental)
void
setKey(QueryKey key)
void
setQuery(Query query)
void
setResultRequests(java.util.List<ResultRequest> resultRequests)
void
setTimeout(java.lang.Long timeout)
java.lang.String
toString()
-
-
-
Constructor Detail
-
SearchRequest
public SearchRequest()
-
SearchRequest
public SearchRequest(QueryKey key, Query query, java.util.List<ResultRequest> resultRequests, java.lang.String dateTimeLocale, java.lang.Boolean incremental, java.lang.Long timeout)
- Parameters:
key
- A unique key to identify the instance of the search by. This key is used to identify multiple requests for the same search when running in incremental mode.query
- The query terms for the searchresultRequests
- A list ofresultRequest
definitions. If null or the list is empty no results will be returned. Allows the caller to request that the results of the query are returned in multiple forms, e.g. using a number of different filtering/aggregation/sorting approaches.dateTimeLocale
- The locale to use when formatting date values in the search results. The value is the string form of azoneId
incremental
- If true the response will contain all results found so far. Future requests for the same query key may return more results. Intended for use on longer running searches to allow partial result sets to be returned as soon as they are available rather than waiting for the full result set.timeout
- Set the maximum time (in ms) for the server to wait for a complete result set. The timeout applies to both incremental and non incremental queries, though the behaviour is slightly different. The timeout will make the server wait for which ever comes first out of the query completing or the timeout period being reached. If no value is supplied then for an incremental query a default value of 0 will be used (i.e. returning immediately) and for a non-incremental query the server's default timeout period will be used. For an incremental query, if the query has not completed by the end of the timeout period, it will return the currently know results with complete=false, however for a non-incremental query it will return no results, complete=false and details of the timeout in the error field
-
SearchRequest
public SearchRequest(QueryKey key, Query query, java.util.List<ResultRequest> resultRequests, java.lang.String dateTimeLocale, java.lang.Boolean incremental)
- Parameters:
key
- As linkedquery
- As linkedresultRequests
- As linkeddateTimeLocale
- As linkedincremental
- As linked
-
-
Method Detail
-
setKey
public void setKey(QueryKey key)
-
setQuery
public void setQuery(Query query)
-
getResultRequests
public java.util.List<ResultRequest> getResultRequests()
- Returns:
- The list of
resultRequest
objects
-
setResultRequests
public void setResultRequests(java.util.List<ResultRequest> resultRequests)
-
getDateTimeLocale
public java.lang.String getDateTimeLocale()
- Returns:
- The locale ID, see
ZoneId
, for the date values uses in the search response.
-
setDateTimeLocale
public void setDateTimeLocale(java.lang.String dateTimeLocale)
-
getIncremental
public java.lang.Boolean getIncremental()
- Returns:
- Whether the search should return immediately with the results found so far or wait for the search to finish
-
setIncremental
public void setIncremental(java.lang.Boolean incremental)
-
getTimeout
public java.lang.Long getTimeout()
- Returns:
- The timeout period in ms. Can be null.
-
setTimeout
public void setTimeout(java.lang.Long timeout)
-
incremental
public boolean incremental()
- Returns:
- Whether the search should return immediately with the results found so far or wait for the search to finish
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-