Class FleetSearchRequest.Builder

All Implemented Interfaces:
WithJson<FleetSearchRequest.Builder>, ObjectBuilder<FleetSearchRequest>
Enclosing class:
FleetSearchRequest

public static class FleetSearchRequest.Builder
extends RequestBase.AbstractBuilder<FleetSearchRequest.Builder>
implements ObjectBuilder<FleetSearchRequest>
Builder for FleetSearchRequest.
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • source

      public final FleetSearchRequest.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 FleetSearchRequest.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 FleetSearchRequest.Builder aggregations​(java.util.Map<java.lang.String,​Aggregation> map)
      API name: aggregations

      Adds all entries of map to aggregations.

    • aggregations

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

      Adds an entry to aggregations.

    • aggregations

      public final FleetSearchRequest.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 FleetSearchRequest.Builder allowNoIndices​(@Nullable java.lang.Boolean value)
      API name: allow_no_indices
    • allowPartialSearchResults

      public final FleetSearchRequest.Builder allowPartialSearchResults​(@Nullable java.lang.Boolean value)
      If true, returns partial results if there are shard request timeouts or shard failures. If false, returns an error with no partial results. Defaults to the configured cluster setting search.default_allow_partial_results which is true by default.

      API name: allow_partial_search_results

    • analyzeWildcard

      public final FleetSearchRequest.Builder analyzeWildcard​(@Nullable java.lang.Boolean value)
      API name: analyze_wildcard
    • analyzer

      public final FleetSearchRequest.Builder analyzer​(@Nullable java.lang.String value)
      API name: analyzer
    • batchedReduceSize

      public final FleetSearchRequest.Builder batchedReduceSize​(@Nullable java.lang.Long value)
      API name: batched_reduce_size
    • ccsMinimizeRoundtrips

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

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

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

      public final FleetSearchRequest.Builder defaultOperator​(@Nullable Operator value)
      API name: default_operator
    • df

      public final FleetSearchRequest.Builder df​(@Nullable java.lang.String value)
      API name: df
    • docvalueFields

      public final FleetSearchRequest.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 FleetSearchRequest.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 FleetSearchRequest.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 FleetSearchRequest.Builder expandWildcards​(java.util.List<ExpandWildcard> list)
      API name: expand_wildcards

      Adds all elements of list to expandWildcards.

    • expandWildcards

      public final FleetSearchRequest.Builder expandWildcards​(ExpandWildcard value, ExpandWildcard... values)
      API name: expand_wildcards

      Adds one or more values to expandWildcards.

    • explain

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

      API name: explain

    • ext

      public final FleetSearchRequest.Builder ext​(java.util.Map<java.lang.String,​JsonData> map)
      Configuration of search extensions defined by Elasticsearch plugins.

      API name: ext

      Adds all entries of map to ext.

    • ext

      public final FleetSearchRequest.Builder ext​(java.lang.String key, JsonData value)
      Configuration of search extensions defined by Elasticsearch plugins.

      API name: ext

      Adds an entry to ext.

    • fields

      public final FleetSearchRequest.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 FleetSearchRequest.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 FleetSearchRequest.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 FleetSearchRequest.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 FleetSearchRequest.Builder highlight​(@Nullable Highlight value)
      API name: highlight
    • highlight

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

      public final FleetSearchRequest.Builder ignoreThrottled​(@Nullable java.lang.Boolean value)
      API name: ignore_throttled
    • ignoreUnavailable

      public final FleetSearchRequest.Builder ignoreUnavailable​(@Nullable java.lang.Boolean value)
      API name: ignore_unavailable
    • index

      public final FleetSearchRequest.Builder index​(java.lang.String value)
      Required - A single target to search. If the target is an index alias, it must resolve to a single index.

      API name: index

    • indicesBoost

      public final FleetSearchRequest.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 FleetSearchRequest.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.

    • lenient

      public final FleetSearchRequest.Builder lenient​(@Nullable java.lang.Boolean value)
      API name: lenient
    • maxConcurrentShardRequests

      public final FleetSearchRequest.Builder maxConcurrentShardRequests​(@Nullable java.lang.Long value)
      API name: max_concurrent_shard_requests
    • minCompatibleShardNode

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

      public final FleetSearchRequest.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 FleetSearchRequest.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 FleetSearchRequest.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 FleetSearchRequest.Builder postFilter​(@Nullable Query value)
      API name: post_filter
    • postFilter

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

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

      public final FleetSearchRequest.Builder preference​(@Nullable java.lang.String value)
      API name: preference
    • profile

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

      public final FleetSearchRequest.Builder q​(@Nullable java.lang.String value)
      API name: q
    • query

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

      API name: query

    • query

      public final FleetSearchRequest.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 FleetSearchRequest.Builder requestCache​(@Nullable java.lang.Boolean value)
      API name: request_cache
    • rescore

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

      Adds all elements of list to rescore.

    • rescore

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

      Adds one or more values to rescore.

    • rescore

      public final FleetSearchRequest.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 FleetSearchRequest.Builder routing​(@Nullable java.lang.String value)
      API name: routing
    • runtimeMappings

      public final FleetSearchRequest.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 FleetSearchRequest.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 FleetSearchRequest.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 FleetSearchRequest.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 FleetSearchRequest.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 FleetSearchRequest.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 FleetSearchRequest.Builder scroll​(@Nullable Time value)
      API name: scroll
    • scroll

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

      public final FleetSearchRequest.Builder searchAfter​(java.util.List<FieldValue> list)
      API name: search_after

      Adds all elements of list to searchAfter.

    • searchAfter

      public final FleetSearchRequest.Builder searchAfter​(FieldValue value, FieldValue... values)
      API name: search_after

      Adds one or more values to searchAfter.

    • searchAfter

      public final FleetSearchRequest.Builder searchAfter​(java.util.function.Function<FieldValue.Builder,​ObjectBuilder<FieldValue>> fn)
      API name: search_after

      Adds a value to searchAfter using a builder lambda.

    • searchType

      public final FleetSearchRequest.Builder searchType​(@Nullable SearchType value)
      API name: search_type
    • seqNoPrimaryTerm

      public final FleetSearchRequest.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 FleetSearchRequest.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 FleetSearchRequest.Builder slice​(@Nullable SlicedScroll value)
      API name: slice
    • slice

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

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

      Adds all elements of list to sort.

    • sort

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

      Adds one or more values to sort.

    • sort

      public final FleetSearchRequest.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 FleetSearchRequest.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 FleetSearchRequest.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 FleetSearchRequest.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 FleetSearchRequest.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 FleetSearchRequest.Builder suggest​(@Nullable Suggester value)
      API name: suggest
    • suggest

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

      public final FleetSearchRequest.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 FleetSearchRequest.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 FleetSearchRequest.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 FleetSearchRequest.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 FleetSearchRequest.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 FleetSearchRequest.Builder version​(@Nullable java.lang.Boolean value)
      If true, returns document version as part of a hit.

      API name: version

    • waitForCheckpoints

      public final FleetSearchRequest.Builder waitForCheckpoints​(java.util.List<java.lang.Long> list)
      A comma separated list of checkpoints. When configured, the search API will only be executed on a shard after the relevant checkpoint has become visible for search. Defaults to an empty list which will cause Elasticsearch to immediately execute the search.

      API name: wait_for_checkpoints

      Adds all elements of list to waitForCheckpoints.

    • waitForCheckpoints

      public final FleetSearchRequest.Builder waitForCheckpoints​(java.lang.Long value, java.lang.Long... values)
      A comma separated list of checkpoints. When configured, the search API will only be executed on a shard after the relevant checkpoint has become visible for search. Defaults to an empty list which will cause Elasticsearch to immediately execute the search.

      API name: wait_for_checkpoints

      Adds one or more values to waitForCheckpoints.

    • self

      protected FleetSearchRequest.Builder self()
      Specified by:
      self in class RequestBase.AbstractBuilder<FleetSearchRequest.Builder>
    • build

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