Class SearchModelsRequest.Builder

All Implemented Interfaces:
CopyableBuilder<SearchModelsRequest.Builder,SearchModelsRequest>, MutableBuilder<SearchModelsRequest.Builder,SearchModelsRequest>, ObjectBuilder<SearchModelsRequest>
Enclosing class:
SearchModelsRequest

Builder for SearchModelsRequest.
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • copy

      @Nonnull public SearchModelsRequest.Builder copy()
      Description copied from interface: CopyableBuilder
      Create a new builder CopyableBuilder that is a copy of this one.
      Specified by:
      copy in interface CopyableBuilder<SearchModelsRequest.Builder,SearchModelsRequest>
      Returns:
      a new builder instance.
    • self

      @Nonnull protected SearchModelsRequest.Builder self()
      Specified by:
      self in class RequestBase.AbstractBuilder<SearchModelsRequest.Builder>
    • allowNoIndices

      @Nonnull public final SearchModelsRequest.Builder allowNoIndices(@Nullable Boolean value)
      Whether to ignore if a wildcard indexes expression resolves into no concrete indexes. (This includes _all string or when no indexes have been specified).

      API name: allow_no_indices

    • allowPartialSearchResults

      @Nonnull public final SearchModelsRequest.Builder allowPartialSearchResults(@Nullable 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

      @Nonnull public final SearchModelsRequest.Builder analyzeWildcard(@Nullable Boolean value)
      Specify whether wildcard and prefix queries should be analyzed.

      API name: analyze_wildcard

    • analyzer

      @Nonnull public final SearchModelsRequest.Builder analyzer(@Nullable String value)
      The analyzer to use for the query string.

      API name: analyzer

    • batchedReduceSize

      @Nonnull public final SearchModelsRequest.Builder batchedReduceSize(@Nullable Integer value)
      The number of shard results that should be reduced at once on the coordinating node. This value should be used as a protection mechanism to reduce the memory overhead per search request if the potential number of shards in the request can be large.

      API name: batched_reduce_size

    • ccsMinimizeRoundtrips

      @Nonnull public final SearchModelsRequest.Builder ccsMinimizeRoundtrips(@Nullable Boolean value)
      Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution.

      API name: ccs_minimize_roundtrips

    • defaultOperator

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

      API name: default_operator

    • df

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

      API name: df

    • docvalueFields

      @Nonnull public final SearchModelsRequest.Builder docvalueFields(List<String> list)
      A comma-separated list of fields to return as the docvalue representation of a field for each hit.

      API name: docvalue_fields

      Adds all elements of list to docvalueFields.

    • docvalueFields

      @Nonnull public final SearchModelsRequest.Builder docvalueFields(String value, String... values)
      A comma-separated list of fields to return as the docvalue representation of a field for each hit.

      API name: docvalue_fields

      Adds one or more values to docvalueFields.

    • expandWildcards

      @Nonnull public final SearchModelsRequest.Builder expandWildcards(List<ExpandWildcard> list)
      Whether to expand wildcard expression to concrete indexes that are open, closed or both.

      API name: expand_wildcards

      Adds all elements of list to expandWildcards.

    • expandWildcards

      @Nonnull public final SearchModelsRequest.Builder expandWildcards(ExpandWildcard value, ExpandWildcard... values)
      Whether to expand wildcard expression to concrete indexes that are open, closed or both.

      API name: expand_wildcards

      Adds one or more values to expandWildcards.

    • explain

      @Nonnull public final SearchModelsRequest.Builder explain(@Nullable Boolean value)
      Specify whether to return detailed information about score computation as part of a hit.

      API name: explain

    • from

      @Nonnull public final SearchModelsRequest.Builder from(@Nullable Integer value)
      Starting offset.

      API name: from

    • ignoreThrottled

      @Nonnull public final SearchModelsRequest.Builder ignoreThrottled(@Nullable Boolean value)
      Whether specified concrete, expanded or aliased indexes should be ignored when throttled.

      API name: ignore_throttled

    • ignoreUnavailable

      @Nonnull public final SearchModelsRequest.Builder ignoreUnavailable(@Nullable Boolean value)
      Whether specified concrete indexes should be ignored when unavailable (missing or closed).

      API name: ignore_unavailable

    • lenient

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

      API name: lenient

    • maxConcurrentShardRequests

      @Nonnull public final SearchModelsRequest.Builder maxConcurrentShardRequests(@Nullable Integer 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

    • preFilterShardSize

      @Nonnull public final SearchModelsRequest.Builder preFilterShardSize(@Nullable Integer value)
      Threshold that enforces a pre-filter round-trip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter round-trip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method, that is if date filters are mandatory to match but the shard bounds and the query are disjoint.

      API name: pre_filter_shard_size

    • preference

      @Nonnull public final SearchModelsRequest.Builder preference(@Nullable String value)
      Specify the node or shard the operation should be performed on.

      API name: preference

    • q

      @Nonnull public final SearchModelsRequest.Builder q(@Nullable String value)
      Query in the Lucene query string syntax.

      API name: q

    • requestCache

      @Nonnull public final SearchModelsRequest.Builder requestCache(@Nullable Boolean value)
      Specify if request cache should be used for this request or not, defaults to index level setting.

      API name: request_cache

    • restTotalHitsAsInt

      @Nonnull public final SearchModelsRequest.Builder restTotalHitsAsInt(@Nullable Boolean value)
      Indicates whether hits.total should be rendered as an integer or an object in the rest search response.

      API name: rest_total_hits_as_int

    • routing

      @Nonnull public final SearchModelsRequest.Builder routing(List<String> list)
      A comma-separated list of specific routing values.

      API name: routing

      Adds all elements of list to routing.

    • routing

      @Nonnull public final SearchModelsRequest.Builder routing(String value, String... values)
      A comma-separated list of specific routing values.

      API name: routing

      Adds one or more values to routing.

    • scroll

      @Nonnull public final SearchModelsRequest.Builder scroll(@Nullable Time value)
      Specify how long a consistent view of the index should be maintained for scrolled search.

      API name: scroll

    • scroll

      Specify how long a consistent view of the index should be maintained for scrolled search.

      API name: scroll

    • searchType

      @Nonnull public final SearchModelsRequest.Builder searchType(@Nullable SearchType value)
      Search operation type.

      API name: search_type

    • seqNoPrimaryTerm

      @Nonnull public final SearchModelsRequest.Builder seqNoPrimaryTerm(@Nullable Boolean value)
      Specify whether to return sequence number and primary term of the last modification of each hit.

      API name: seq_no_primary_term

    • size

      @Nonnull public final SearchModelsRequest.Builder size(@Nullable Integer value)
      Number of hits to return.

      API name: size

    • sort

      @Nonnull public final SearchModelsRequest.Builder sort(List<String> list)
      A comma-separated list of <field>:<direction> pairs.

      API name: sort

      Adds all elements of list to sort.

    • sort

      @Nonnull public final SearchModelsRequest.Builder sort(String value, String... values)
      A comma-separated list of <field>:<direction> pairs.

      API name: sort

      Adds one or more values to sort.

    • source

      @Nonnull public final SearchModelsRequest.Builder source(List<String> list)
      Set to true or false to return the _source field or not, or a list of fields to return.

      API name: _source

      Adds all elements of list to source.

    • source

      @Nonnull public final SearchModelsRequest.Builder source(String value, String... values)
      Set to true or false to return the _source field or not, or a list of fields to return.

      API name: _source

      Adds one or more values to source.

    • sourceExcludes

      @Nonnull public final SearchModelsRequest.Builder sourceExcludes(List<String> list)
      List of fields to exclude from the returned _source field.

      API name: _source_excludes

      Adds all elements of list to sourceExcludes.

    • sourceExcludes

      @Nonnull public final SearchModelsRequest.Builder sourceExcludes(String value, String... values)
      List of fields to exclude from the returned _source field.

      API name: _source_excludes

      Adds one or more values to sourceExcludes.

    • sourceIncludes

      @Nonnull public final SearchModelsRequest.Builder sourceIncludes(List<String> list)
      List of fields to extract and return from the _source field.

      API name: _source_includes

      Adds all elements of list to sourceIncludes.

    • sourceIncludes

      @Nonnull public final SearchModelsRequest.Builder sourceIncludes(String value, String... values)
      List of fields to extract and return from the _source field.

      API name: _source_includes

      Adds one or more values to sourceIncludes.

    • stats

      @Nonnull public final SearchModelsRequest.Builder stats(List<String> list)
      Specific 'tag' of the request for logging and statistical purposes.

      API name: stats

      Adds all elements of list to stats.

    • stats

      @Nonnull public final SearchModelsRequest.Builder stats(String value, String... values)
      Specific 'tag' of the request for logging and statistical purposes.

      API name: stats

      Adds one or more values to stats.

    • storedFields

      @Nonnull public final SearchModelsRequest.Builder storedFields(List<String> list)
      A comma-separated list of stored fields to return.

      API name: stored_fields

      Adds all elements of list to storedFields.

    • storedFields

      @Nonnull public final SearchModelsRequest.Builder storedFields(String value, String... values)
      A comma-separated list of stored fields to return.

      API name: stored_fields

      Adds one or more values to storedFields.

    • suggestField

      @Nonnull public final SearchModelsRequest.Builder suggestField(@Nullable String value)
      Specify which field to use for suggestions.

      API name: suggest_field

    • suggestMode

      @Nonnull public final SearchModelsRequest.Builder suggestMode(@Nullable SuggestMode value)
      Specify suggest mode.

      API name: suggest_mode

    • suggestSize

      @Nonnull public final SearchModelsRequest.Builder suggestSize(@Nullable Integer value)
      How many suggestions to return in response.

      API name: suggest_size

    • suggestText

      @Nonnull public final SearchModelsRequest.Builder suggestText(@Nullable String value)
      The source text for which the suggestions should be returned.

      API name: suggest_text

    • terminateAfter

      @Nonnull public final SearchModelsRequest.Builder terminateAfter(@Nullable Integer value)
      The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early.

      API name: terminate_after

    • timeout

      @Nonnull public final SearchModelsRequest.Builder timeout(@Nullable Time value)
      Operation timeout.

      API name: timeout

    • timeout

      @Nonnull public final SearchModelsRequest.Builder timeout(Function<Time.Builder,ObjectBuilder<Time>> fn)
      Operation timeout.

      API name: timeout

    • trackScores

      @Nonnull public final SearchModelsRequest.Builder trackScores(@Nullable Boolean value)
      Whether to calculate and return scores even if they are not used for sorting.

      API name: track_scores

    • trackTotalHits

      @Nonnull public final SearchModelsRequest.Builder trackTotalHits(@Nullable Boolean value)
      Indicate if the number of documents that match the query should be tracked.

      API name: track_total_hits

    • version

      @Nonnull public final SearchModelsRequest.Builder version(@Nullable Boolean value)
      Whether to return document version as part of a hit.

      API name: version

    • build

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