Class SubmitRequest.Builder

java.lang.Object
co.elastic.clients.util.ObjectBuilderBase
co.elastic.clients.elasticsearch.async_search.SubmitRequest.Builder
All Implemented Interfaces:
ObjectBuilder<SubmitRequest>
Enclosing class:
SubmitRequest

public static class SubmitRequest.Builder
extends ObjectBuilderBase
implements ObjectBuilder<SubmitRequest>
Builder for SubmitRequest.
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • source

      public final SubmitRequest.Builder source​(@Nullable SourceConfig value)
      Indicates which source fields are returned for matching documents. These fields are returned in the hits._source property of the search response.

      API name: _source

    • source

      public final SubmitRequest.Builder source​(java.util.function.Function<SourceConfig.Builder,​ObjectBuilder<SourceConfig>> fn)
      Indicates which source fields are returned for matching documents. These fields are returned in the hits._source property of the search response.

      API name: _source

    • aggregations

      public final SubmitRequest.Builder aggregations​(java.util.Map<java.lang.String,​Aggregation> map)
      API name: aggregations

      Adds all entries of map to aggregations.

    • aggregations

      public final SubmitRequest.Builder aggregations​(java.lang.String key, Aggregation value)
      API name: aggregations

      Adds an entry to aggregations.

    • aggregations

      public final SubmitRequest.Builder aggregations​(java.lang.String key, java.util.function.Function<Aggregation.Builder,​ObjectBuilder<Aggregation>> fn)
      API name: aggregations

      Adds an entry to aggregations using a builder lambda.

    • allowNoIndices

      public final SubmitRequest.Builder allowNoIndices​(@Nullable java.lang.Boolean value)
      Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes _all string or when no indices have been specified)

      API name: allow_no_indices

    • allowPartialSearchResults

      public final SubmitRequest.Builder allowPartialSearchResults​(@Nullable java.lang.Boolean value)
      Indicate if an error should be returned if there is a partial search failure or timeout

      API name: allow_partial_search_results

    • analyzeWildcard

      public final SubmitRequest.Builder analyzeWildcard​(@Nullable java.lang.Boolean value)
      Specify whether wildcard and prefix queries should be analyzed (default: false)

      API name: analyze_wildcard

    • analyzer

      public final SubmitRequest.Builder analyzer​(@Nullable java.lang.String value)
      The analyzer to use for the query string

      API name: analyzer

    • batchedReduceSize

      public final SubmitRequest.Builder batchedReduceSize​(@Nullable java.lang.Long value)
      The number of shard results that should be reduced at once on the coordinating node. This value should be used as the granularity at which progress results will be made available.

      API name: batched_reduce_size

    • ccsMinimizeRoundtrips

      public final SubmitRequest.Builder ccsMinimizeRoundtrips​(@Nullable java.lang.Boolean value)
      API name: ccs_minimize_roundtrips
    • collapse

      public final SubmitRequest.Builder collapse​(@Nullable FieldCollapse value)
      API name: collapse
    • collapse

      public final SubmitRequest.Builder collapse​(java.util.function.Function<FieldCollapse.Builder,​ObjectBuilder<FieldCollapse>> fn)
      API name: collapse
    • defaultOperator

      public final SubmitRequest.Builder defaultOperator​(@Nullable Operator value)
      The default operator for query string query (AND or OR)

      API name: default_operator

    • df

      public final SubmitRequest.Builder df​(@Nullable java.lang.String value)
      The field to use as default where no field prefix is given in the query string

      API name: df

    • docvalueFields

      public final SubmitRequest.Builder docvalueFields​(java.util.List<FieldAndFormat> list)
      Array of wildcard (*) patterns. The request returns doc values for field names matching these patterns in the hits.fields property of the response.

      API name: docvalue_fields

      Adds all elements of list to docvalueFields.

    • docvalueFields

      public final SubmitRequest.Builder docvalueFields​(FieldAndFormat value, FieldAndFormat... values)
      Array of wildcard (*) patterns. The request returns doc values for field names matching these patterns in the hits.fields property of the response.

      API name: docvalue_fields

      Adds one or more values to docvalueFields.

    • docvalueFields

      public final SubmitRequest.Builder docvalueFields​(java.util.function.Function<FieldAndFormat.Builder,​ObjectBuilder<FieldAndFormat>> fn)
      Array of wildcard (*) patterns. The request returns doc values for field names matching these patterns in the hits.fields property of the response.

      API name: docvalue_fields

      Adds a value to docvalueFields using a builder lambda.

    • expandWildcards

      public final SubmitRequest.Builder expandWildcards​(java.util.List<ExpandWildcard> list)
      Whether to expand wildcard expression to concrete indices that are open, closed or both.

      API name: expand_wildcards

      Adds all elements of list to expandWildcards.

    • expandWildcards

      public final SubmitRequest.Builder expandWildcards​(ExpandWildcard value, ExpandWildcard... values)
      Whether to expand wildcard expression to concrete indices that are open, closed or both.

      API name: expand_wildcards

      Adds one or more values to expandWildcards.

    • explain

      public final SubmitRequest.Builder explain​(@Nullable java.lang.Boolean value)
      If true, returns detailed information about score computation as part of a hit.

      API name: explain

    • fields

      public final SubmitRequest.Builder fields​(java.util.List<FieldAndFormat> list)
      Array of wildcard (*) patterns. The request returns values for field names matching these patterns in the hits.fields property of the response.

      API name: fields

      Adds all elements of list to fields.

    • fields

      public final SubmitRequest.Builder fields​(FieldAndFormat value, FieldAndFormat... values)
      Array of wildcard (*) patterns. The request returns values for field names matching these patterns in the hits.fields property of the response.

      API name: fields

      Adds one or more values to fields.

    • fields

      public final SubmitRequest.Builder fields​(java.util.function.Function<FieldAndFormat.Builder,​ObjectBuilder<FieldAndFormat>> fn)
      Array of wildcard (*) patterns. The request returns values for field names matching these patterns in the hits.fields property of the response.

      API name: fields

      Adds a value to fields using a builder lambda.

    • from

      public final SubmitRequest.Builder from​(@Nullable java.lang.Integer value)
      Starting document offset. By default, you cannot page through more than 10,000 hits using the from and size parameters. To page through more hits, use the search_after parameter.

      API name: from

    • highlight

      public final SubmitRequest.Builder highlight​(@Nullable Highlight value)
      API name: highlight
    • highlight

      public final SubmitRequest.Builder highlight​(java.util.function.Function<Highlight.Builder,​ObjectBuilder<Highlight>> fn)
      API name: highlight
    • ignoreThrottled

      public final SubmitRequest.Builder ignoreThrottled​(@Nullable java.lang.Boolean value)
      Whether specified concrete, expanded or aliased indices should be ignored when throttled

      API name: ignore_throttled

    • ignoreUnavailable

      public final SubmitRequest.Builder ignoreUnavailable​(@Nullable java.lang.Boolean value)
      Whether specified concrete indices should be ignored when unavailable (missing or closed)

      API name: ignore_unavailable

    • index

      public final SubmitRequest.Builder index​(java.util.List<java.lang.String> list)
      A comma-separated list of index names to search; use _all or empty string to perform the operation on all indices

      API name: index

      Adds all elements of list to index.

    • index

      public final SubmitRequest.Builder index​(java.lang.String value, java.lang.String... values)
      A comma-separated list of index names to search; use _all or empty string to perform the operation on all indices

      API name: index

      Adds one or more values to index.

    • indicesBoost

      public final SubmitRequest.Builder indicesBoost​(java.util.List<java.util.Map<java.lang.String,​java.lang.Double>> list)
      Boosts the _score of documents from specified indices.

      API name: indices_boost

      Adds all elements of list to indicesBoost.

    • indicesBoost

      public final SubmitRequest.Builder indicesBoost​(java.util.Map<java.lang.String,​java.lang.Double> value, java.util.Map<java.lang.String,​java.lang.Double>... values)
      Boosts the _score of documents from specified indices.

      API name: indices_boost

      Adds one or more values to indicesBoost.

    • keepAlive

      public final SubmitRequest.Builder keepAlive​(@Nullable Time value)
      Update the time interval in which the results (partial or final) for this search will be available

      API name: keep_alive

    • keepAlive

      public final SubmitRequest.Builder keepAlive​(java.util.function.Function<Time.Builder,​ObjectBuilder<Time>> fn)
      Update the time interval in which the results (partial or final) for this search will be available

      API name: keep_alive

    • keepOnCompletion

      public final SubmitRequest.Builder keepOnCompletion​(@Nullable java.lang.Boolean value)
      Control whether the response should be stored in the cluster if it completed within the provided [wait_for_completion] time (default: false)

      API name: keep_on_completion

    • lenient

      public final SubmitRequest.Builder lenient​(@Nullable java.lang.Boolean value)
      Specify whether format-based query failures (such as providing text to a numeric field) should be ignored

      API name: lenient

    • maxConcurrentShardRequests

      public final SubmitRequest.Builder maxConcurrentShardRequests​(@Nullable java.lang.Long value)
      The number of concurrent shard requests per node this search executes concurrently. This value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests

      API name: max_concurrent_shard_requests

    • minCompatibleShardNode

      public final SubmitRequest.Builder minCompatibleShardNode​(@Nullable java.lang.String value)
      API name: min_compatible_shard_node
    • minScore

      public final SubmitRequest.Builder minScore​(@Nullable java.lang.Double value)
      Minimum _score for matching documents. Documents with a lower _score are not included in the search results.

      API name: min_score

    • pit

      public final SubmitRequest.Builder pit​(@Nullable PointInTimeReference value)
      Limits the search to a point in time (PIT). If you provide a PIT, you cannot specify an <index> in the request path.

      API name: pit

    • pit

      public final SubmitRequest.Builder pit​(java.util.function.Function<PointInTimeReference.Builder,​ObjectBuilder<PointInTimeReference>> fn)
      Limits the search to a point in time (PIT). If you provide a PIT, you cannot specify an <index> in the request path.

      API name: pit

    • postFilter

      public final SubmitRequest.Builder postFilter​(@Nullable Query value)
      API name: post_filter
    • postFilter

      public final SubmitRequest.Builder postFilter​(java.util.function.Function<Query.Builder,​ObjectBuilder<Query>> fn)
      API name: post_filter
    • preFilterShardSize

      public final SubmitRequest.Builder preFilterShardSize​(@Nullable java.lang.Long value)
      API name: pre_filter_shard_size
    • preference

      public final SubmitRequest.Builder preference​(@Nullable java.lang.String value)
      Specify the node or shard the operation should be performed on (default: random)

      API name: preference

    • profile

      public final SubmitRequest.Builder profile​(@Nullable java.lang.Boolean value)
      API name: profile
    • q

      public final SubmitRequest.Builder q​(@Nullable java.lang.String value)
      Query in the Lucene query string syntax

      API name: q

    • query

      public final SubmitRequest.Builder query​(@Nullable Query value)
      Defines the search definition using the Query DSL.

      API name: query

    • query

      public final SubmitRequest.Builder query​(java.util.function.Function<Query.Builder,​ObjectBuilder<Query>> fn)
      Defines the search definition using the Query DSL.

      API name: query

    • requestCache

      public final SubmitRequest.Builder requestCache​(@Nullable java.lang.Boolean value)
      Specify if request cache should be used for this request or not, defaults to true

      API name: request_cache

    • rescore

      public final SubmitRequest.Builder rescore​(java.util.List<Rescore> list)
      API name: rescore

      Adds all elements of list to rescore.

    • rescore

      public final SubmitRequest.Builder rescore​(Rescore value, Rescore... values)
      API name: rescore

      Adds one or more values to rescore.

    • rescore

      public final SubmitRequest.Builder rescore​(java.util.function.Function<Rescore.Builder,​ObjectBuilder<Rescore>> fn)
      API name: rescore

      Adds a value to rescore using a builder lambda.

    • routing

      public final SubmitRequest.Builder routing​(@Nullable java.lang.String value)
      A comma-separated list of specific routing values

      API name: routing

    • runtimeMappings

      public final SubmitRequest.Builder runtimeMappings​(java.util.Map<java.lang.String,​RuntimeField> map)
      Defines one or more runtime fields in the search request. These fields take precedence over mapped fields with the same name.

      API name: runtime_mappings

      Adds all entries of map to runtimeMappings.

    • runtimeMappings

      public final SubmitRequest.Builder runtimeMappings​(java.lang.String key, RuntimeField value)
      Defines one or more runtime fields in 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 SubmitRequest.Builder runtimeMappings​(java.lang.String key, java.util.function.Function<RuntimeField.Builder,​ObjectBuilder<RuntimeField>> fn)
      Defines one or more runtime fields in 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.

    • scriptFields

      public final SubmitRequest.Builder scriptFields​(java.util.Map<java.lang.String,​ScriptField> map)
      Retrieve a script evaluation (based on different fields) for each hit.

      API name: script_fields

      Adds all entries of map to scriptFields.

    • scriptFields

      public final SubmitRequest.Builder scriptFields​(java.lang.String key, ScriptField value)
      Retrieve a script evaluation (based on different fields) for each hit.

      API name: script_fields

      Adds an entry to scriptFields.

    • scriptFields

      public final SubmitRequest.Builder scriptFields​(java.lang.String key, java.util.function.Function<ScriptField.Builder,​ObjectBuilder<ScriptField>> fn)
      Retrieve a script evaluation (based on different fields) for each hit.

      API name: script_fields

      Adds an entry to scriptFields using a builder lambda.

    • scroll

      public final SubmitRequest.Builder scroll​(@Nullable Time value)
      API name: scroll
    • scroll

      public final SubmitRequest.Builder scroll​(java.util.function.Function<Time.Builder,​ObjectBuilder<Time>> fn)
      API name: scroll
    • searchAfter

      public final SubmitRequest.Builder searchAfter​(java.util.List<java.lang.String> list)
      API name: search_after

      Adds all elements of list to searchAfter.

    • searchAfter

      public final SubmitRequest.Builder searchAfter​(java.lang.String value, java.lang.String... values)
      API name: search_after

      Adds one or more values to searchAfter.

    • searchType

      public final SubmitRequest.Builder searchType​(@Nullable SearchType value)
      Search operation type

      API name: search_type

    • seqNoPrimaryTerm

      public final SubmitRequest.Builder seqNoPrimaryTerm​(@Nullable java.lang.Boolean value)
      If true, returns sequence number and primary term of the last modification of each hit. See Optimistic concurrency control.

      API name: seq_no_primary_term

    • size

      public final SubmitRequest.Builder size​(@Nullable java.lang.Integer value)
      The number of hits to return. By default, you cannot page through more than 10,000 hits using the from and size parameters. To page through more hits, use the search_after parameter.

      API name: size

    • slice

      public final SubmitRequest.Builder slice​(@Nullable SlicedScroll value)
      API name: slice
    • slice

      public final SubmitRequest.Builder slice​(java.util.function.Function<SlicedScroll.Builder,​ObjectBuilder<SlicedScroll>> fn)
      API name: slice
    • sort

      public final SubmitRequest.Builder sort​(java.util.List<SortOptions> list)
      API name: sort

      Adds all elements of list to sort.

    • sort

      public final SubmitRequest.Builder sort​(SortOptions value, SortOptions... values)
      API name: sort

      Adds one or more values to sort.

    • sort

      public final SubmitRequest.Builder sort​(java.util.function.Function<SortOptions.Builder,​ObjectBuilder<SortOptions>> fn)
      API name: sort

      Adds a value to sort using a builder lambda.

    • stats

      public final SubmitRequest.Builder stats​(java.util.List<java.lang.String> list)
      Stats groups to associate with the search. Each group maintains a statistics aggregation for its associated searches. You can retrieve these stats using the indices stats API.

      API name: stats

      Adds all elements of list to stats.

    • stats

      public final SubmitRequest.Builder stats​(java.lang.String value, java.lang.String... values)
      Stats groups to associate with the search. Each group maintains a statistics aggregation for its associated searches. You can retrieve these stats using the indices stats API.

      API name: stats

      Adds one or more values to stats.

    • storedFields

      public final SubmitRequest.Builder storedFields​(java.util.List<java.lang.String> list)
      List of stored fields to return as part of a hit. If no fields are specified, no stored fields are included in the response. If this field is specified, the _source parameter defaults to false. You can pass _source: true to return both source fields and stored fields in the search response.

      API name: stored_fields

      Adds all elements of list to storedFields.

    • storedFields

      public final SubmitRequest.Builder storedFields​(java.lang.String value, java.lang.String... values)
      List of stored fields to return as part of a hit. If no fields are specified, no stored fields are included in the response. If this field is specified, the _source parameter defaults to false. You can pass _source: true to return both source fields and stored fields in the search response.

      API name: stored_fields

      Adds one or more values to storedFields.

    • suggest

      public final SubmitRequest.Builder suggest​(@Nullable Suggester value)
      API name: suggest
    • suggest

      public final SubmitRequest.Builder suggest​(java.util.function.Function<Suggester.Builder,​ObjectBuilder<Suggester>> fn)
      API name: suggest
    • terminateAfter

      public final SubmitRequest.Builder terminateAfter​(@Nullable java.lang.Long value)
      Maximum number of documents to collect for each shard. If a query reaches this limit, Elasticsearch terminates the query early. Elasticsearch collects documents before sorting. Defaults to 0, which does not terminate query execution early.

      API name: terminate_after

    • timeout

      public final SubmitRequest.Builder timeout​(@Nullable java.lang.String value)
      Specifies the period of time to wait for a response from each shard. If no response is received before the timeout expires, the request fails and returns an error. Defaults to no timeout.

      API name: timeout

    • trackScores

      public final SubmitRequest.Builder trackScores​(@Nullable java.lang.Boolean value)
      If true, calculate and return document scores, even if the scores are not used for sorting.

      API name: track_scores

    • trackTotalHits

      public final SubmitRequest.Builder trackTotalHits​(@Nullable TrackHits value)
      Number of hits matching the query to count accurately. If true, the exact number of hits is returned at the cost of some performance. If false, the response does not include the total number of hits matching the query. Defaults to 10,000 hits.

      API name: track_total_hits

    • trackTotalHits

      public final SubmitRequest.Builder trackTotalHits​(java.util.function.Function<TrackHits.Builder,​ObjectBuilder<TrackHits>> fn)
      Number of hits matching the query to count accurately. If true, the exact number of hits is returned at the cost of some performance. If false, the response does not include the total number of hits matching the query. Defaults to 10,000 hits.

      API name: track_total_hits

    • version

      public final SubmitRequest.Builder version​(@Nullable java.lang.Boolean value)
      If true, returns document version as part of a hit.

      API name: version

    • waitForCompletionTimeout

      public final SubmitRequest.Builder waitForCompletionTimeout​(@Nullable Time value)
      Specify the time that the request should block waiting for the final response

      API name: wait_for_completion_timeout

    • waitForCompletionTimeout

      public final SubmitRequest.Builder waitForCompletionTimeout​(java.util.function.Function<Time.Builder,​ObjectBuilder<Time>> fn)
      Specify the time that the request should block waiting for the final response

      API name: wait_for_completion_timeout

    • build

      public SubmitRequest build()
      Builds a SubmitRequest.
      Specified by:
      build in interface ObjectBuilder<SubmitRequest>
      Throws:
      java.lang.NullPointerException - if some of the required fields are null.