Class QueryRequest.Builder
- All Implemented Interfaces:
WithJson<QueryRequest.Builder>
,ObjectBuilder<QueryRequest>
- Enclosing class:
- QueryRequest
QueryRequest
.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal QueryRequest.Builder
allowPartialSearchResults
(Boolean value) Iftrue
, the response has partial results when there are shard request timeouts or shard failures.build()
Builds aQueryRequest
.final QueryRequest.Builder
The default catalog (cluster) for queries.final QueryRequest.Builder
Iftrue
, the results are in a columnar fashion: one row represents all the values of a certain column from the current page of results.final QueryRequest.Builder
The cursor used to retrieve a set of paginated results.final QueryRequest.Builder
The maximum number of rows (or entries) to return in one response.final QueryRequest.Builder
fieldMultiValueLeniency
(Boolean value) Iffalse
, the API returns an exception when encountering multiple values for a field.final QueryRequest.Builder
The Elasticsearch query DSL for additional filtering.final QueryRequest.Builder
filter
(QueryVariant value) The Elasticsearch query DSL for additional filtering.final QueryRequest.Builder
The Elasticsearch query DSL for additional filtering.final QueryRequest.Builder
The format for the response.final QueryRequest.Builder
indexUsingFrozen
(Boolean value) Iftrue
, the search can run on frozen indices.final QueryRequest.Builder
The retention period for an async or saved synchronous search.final QueryRequest.Builder
The retention period for an async or saved synchronous search.final QueryRequest.Builder
keepOnCompletion
(Boolean value) Iftrue
, Elasticsearch stores synchronous searches if you also specify thewait_for_completion_timeout
parameter.final QueryRequest.Builder
pageTimeout
(Time value) The minimum retention period for the scroll cursor.final QueryRequest.Builder
The minimum retention period for the scroll cursor.final QueryRequest.Builder
The values for parameters in the query.final QueryRequest.Builder
The values for parameters in the query.final QueryRequest.Builder
The SQL query to run.final QueryRequest.Builder
requestTimeout
(Time value) The timeout before the request fails.final QueryRequest.Builder
The timeout before the request fails.final QueryRequest.Builder
runtimeMappings
(String key, RuntimeField value) One or more runtime fields for the search request.final QueryRequest.Builder
One or more runtime fields for the search request.final QueryRequest.Builder
runtimeMappings
(Map<String, RuntimeField> map) One or more runtime fields for the search request.protected QueryRequest.Builder
self()
final QueryRequest.Builder
The ISO-8601 time zone ID for the search.final QueryRequest.Builder
waitForCompletionTimeout
(Time value) The period to wait for complete results.final QueryRequest.Builder
The period to wait for complete results.Methods inherited from class co.elastic.clients.util.WithJsonObjectBuilderBase
withJson
Methods inherited from class co.elastic.clients.util.ObjectBuilderBase
_checkSingleUse, _listAdd, _listAddAll, _mapPut, _mapPutAll
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
allowPartialSearchResults
Iftrue
, the response has partial results when there are shard request timeouts or shard failures. Iffalse
, the API returns an error with no partial results.API name:
allow_partial_search_results
-
catalog
The default catalog (cluster) for queries. If unspecified, the queries execute on the data in the local cluster only.API name:
catalog
-
columnar
Iftrue
, the results are in a columnar fashion: one row represents all the values of a certain column from the current page of results. The API supports this parameter only for CBOR, JSON, SMILE, and YAML responses.API name:
columnar
-
cursor
The cursor used to retrieve a set of paginated results. If you specify a cursor, the API only uses thecolumnar
andtime_zone
request body parameters. It ignores other request body parameters.API name:
cursor
-
fetchSize
The maximum number of rows (or entries) to return in one response.API name:
fetch_size
-
fieldMultiValueLeniency
Iffalse
, the API returns an exception when encountering multiple values for a field. Iftrue
, the API is lenient and returns the first value from the array with no guarantee of consistent results.API name:
field_multi_value_leniency
-
filter
The Elasticsearch query DSL for additional filtering.API name:
filter
-
filter
The Elasticsearch query DSL for additional filtering.API name:
filter
-
filter
The Elasticsearch query DSL for additional filtering.API name:
filter
-
format
The format for the response. You can also specify a format using theAccept
HTTP header. If you specify both this parameter and theAccept
HTTP header, this parameter takes precedence.API name:
format
-
indexUsingFrozen
Iftrue
, the search can run on frozen indices.API name:
index_using_frozen
-
keepAlive
The retention period for an async or saved synchronous search.API name:
keep_alive
-
keepAlive
The retention period for an async or saved synchronous search.API name:
keep_alive
-
keepOnCompletion
Iftrue
, Elasticsearch stores synchronous searches if you also specify thewait_for_completion_timeout
parameter. Iffalse
, Elasticsearch only stores async searches that don't finish before thewait_for_completion_timeout
.API name:
keep_on_completion
-
pageTimeout
The minimum retention period for the scroll cursor. After this time period, a pagination request might fail because the scroll cursor is no longer available. Subsequent scroll requests prolong the lifetime of the scroll cursor by the duration ofpage_timeout
in the scroll request.API name:
page_timeout
-
pageTimeout
The minimum retention period for the scroll cursor. After this time period, a pagination request might fail because the scroll cursor is no longer available. Subsequent scroll requests prolong the lifetime of the scroll cursor by the duration ofpage_timeout
in the scroll request.API name:
page_timeout
-
params
The values for parameters in the query.API name:
params
Adds all entries of
map
toparams
. -
params
The values for parameters in the query.API name:
params
Adds an entry to
params
. -
query
The SQL query to run.API name:
query
-
requestTimeout
The timeout before the request fails.API name:
request_timeout
-
requestTimeout
The timeout before the request fails.API name:
request_timeout
-
runtimeMappings
One or more runtime fields for the search request. These fields take precedence over mapped fields with the same name.API name:
runtime_mappings
Adds all entries of
map
toruntimeMappings
. -
runtimeMappings
One or more runtime fields for the search request. These fields take precedence over mapped fields with the same name.API name:
runtime_mappings
Adds an entry to
runtimeMappings
. -
runtimeMappings
public final QueryRequest.Builder runtimeMappings(String key, Function<RuntimeField.Builder, ObjectBuilder<RuntimeField>> fn) One or more runtime fields for the search request. These fields take precedence over mapped fields with the same name.API name:
runtime_mappings
Adds an entry to
runtimeMappings
using a builder lambda. -
timeZone
The ISO-8601 time zone ID for the search.API name:
time_zone
-
waitForCompletionTimeout
The period to wait for complete results. It defaults to no timeout, meaning the request waits for complete search results. If the search doesn't finish within this period, the search becomes async.To save a synchronous search, you must specify this parameter and the
keep_on_completion
parameter.API name:
wait_for_completion_timeout
-
waitForCompletionTimeout
public final QueryRequest.Builder waitForCompletionTimeout(Function<Time.Builder, ObjectBuilder<Time>> fn) The period to wait for complete results. It defaults to no timeout, meaning the request waits for complete search results. If the search doesn't finish within this period, the search becomes async.To save a synchronous search, you must specify this parameter and the
keep_on_completion
parameter.API name:
wait_for_completion_timeout
-
self
- Specified by:
self
in classRequestBase.AbstractBuilder<QueryRequest.Builder>
-
build
Builds aQueryRequest
.- Specified by:
build
in interfaceObjectBuilder<QueryRequest>
- Throws:
NullPointerException
- if some of the required fields are null.
-