Class SearchRequest.Builder
- java.lang.Object
-
- org.opensearch.client.util.ObjectBuilderBase
-
- org.opensearch.client.opensearch.core.SearchRequest.Builder
-
- All Implemented Interfaces:
ObjectBuilder<SearchRequest>
- Enclosing class:
- SearchRequest
public static class SearchRequest.Builder extends ObjectBuilderBase implements ObjectBuilder<SearchRequest>
Builder forSearchRequest.
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SearchRequest.Builderaggregations(java.lang.String key, java.util.function.Function<Aggregation.Builder,ObjectBuilder<Aggregation>> fn)API name:aggregationsSearchRequest.Builderaggregations(java.lang.String key, Aggregation value)API name:aggregationsSearchRequest.Builderaggregations(java.util.Map<java.lang.String,Aggregation> map)API name:aggregationsSearchRequest.BuilderallowNoIndices(java.lang.Boolean value)Whether to ignore if a wildcard indices expression resolves into no concrete indices.SearchRequest.BuilderallowPartialSearchResults(java.lang.Boolean value)Indicate if an error should be returned if there is a partial search failure or timeoutSearchRequest.Builderanalyzer(java.lang.String value)The analyzer to use for the query stringSearchRequest.BuilderanalyzeWildcard(java.lang.Boolean value)Specify whether wildcard and prefix queries should be analyzed (default: false)SearchRequest.BuilderbatchedReduceSize(java.lang.Long value)The number of shard results that should be reduced at once on the coordinating node.SearchRequestbuild()Builds aSearchRequest.SearchRequest.BuilderccsMinimizeRoundtrips(java.lang.Boolean value)Indicates whether network round-trips should be minimized as part of cross-cluster search requests executionSearchRequest.Buildercollapse(java.util.function.Function<FieldCollapse.Builder,ObjectBuilder<FieldCollapse>> fn)API name:collapseSearchRequest.Buildercollapse(FieldCollapse value)API name:collapseSearchRequest.BuilderdefaultOperator(Operator value)The default operator for query string query (AND or OR)SearchRequest.Builderdf(java.lang.String value)The field to use as default where no field prefix is given in the query stringSearchRequest.BuilderdocvalueFields(java.util.function.Function<FieldAndFormat.Builder,ObjectBuilder<FieldAndFormat>> fn)Array of wildcard (*) patterns.SearchRequest.BuilderdocvalueFields(java.util.List<FieldAndFormat> list)Array of wildcard (*) patterns.SearchRequest.BuilderdocvalueFields(FieldAndFormat value, FieldAndFormat... values)Array of wildcard (*) patterns.SearchRequest.BuilderexpandWildcards(java.util.List<ExpandWildcard> list)Whether to expand wildcard expression to concrete indices that are open, closed or both.SearchRequest.BuilderexpandWildcards(ExpandWildcard value, ExpandWildcard... values)Whether to expand wildcard expression to concrete indices that are open, closed or both.SearchRequest.Builderexplain(java.lang.Boolean value)If true, returns detailed information about score computation as part of a hit.SearchRequest.Builderfields(java.util.function.Function<FieldAndFormat.Builder,ObjectBuilder<FieldAndFormat>> fn)Array of wildcard (*) patterns.SearchRequest.Builderfields(java.util.List<FieldAndFormat> list)Array of wildcard (*) patterns.SearchRequest.Builderfields(FieldAndFormat value, FieldAndFormat... values)Array of wildcard (*) patterns.SearchRequest.Builderfrom(java.lang.Integer value)Starting document offset.SearchRequest.Builderhighlight(java.util.function.Function<Highlight.Builder,ObjectBuilder<Highlight>> fn)API name:highlightSearchRequest.Builderhighlight(Highlight value)API name:highlightSearchRequest.BuilderignoreThrottled(java.lang.Boolean value)Whether specified concrete, expanded or aliased indices should be ignored when throttledSearchRequest.BuilderignoreUnavailable(java.lang.Boolean value)Whether specified concrete indices should be ignored when unavailable (missing or closed)SearchRequest.Builderindex(java.lang.String value, java.lang.String... values)A comma-separated list of index names to search; use_allor empty string to perform the operation on all indicesSearchRequest.Builderindex(java.util.List<java.lang.String> list)A comma-separated list of index names to search; use_allor empty string to perform the operation on all indicesSearchRequest.BuilderindicesBoost(java.util.List<java.util.Map<java.lang.String,java.lang.Double>> list)Boosts the _score of documents from specified indices.SearchRequest.BuilderindicesBoost(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.SearchRequest.Builderlenient(java.lang.Boolean value)Specify whether format-based query failures (such as providing text to a numeric field) should be ignoredSearchRequest.BuildermaxConcurrentShardRequests(java.lang.Long value)The number of concurrent shard requests per node this search executes concurrently.SearchRequest.BuilderminCompatibleShardNode(java.lang.String value)The minimum compatible version that all shards involved in search should have for this request to be successfulSearchRequest.BuilderminScore(java.lang.Double value)Minimum _score for matching documents.SearchRequest.Builderpit(Pit pit)API name:pitSearchRequest.BuilderpostFilter(java.util.function.Function<Query.Builder,ObjectBuilder<Query>> fn)API name:post_filterSearchRequest.BuilderpostFilter(Query value)API name:post_filterSearchRequest.Builderpreference(java.lang.String value)Specify the node or shard the operation should be performed on (default: random)SearchRequest.BuilderpreFilterShardSize(java.lang.Long value)A threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold.SearchRequest.Builderprofile(java.lang.Boolean value)API name:profileSearchRequest.Builderq(java.lang.String value)Query in the Lucene query string syntaxSearchRequest.Builderquery(java.util.function.Function<Query.Builder,ObjectBuilder<Query>> fn)Defines the search definition using the Query DSL.SearchRequest.Builderquery(Query value)Defines the search definition using the Query DSL.SearchRequest.BuilderrequestCache(java.lang.Boolean value)Specify if request cache should be used for this request or not, defaults to index level settingSearchRequest.Builderrescore(java.util.function.Function<Rescore.Builder,ObjectBuilder<Rescore>> fn)API name:rescoreSearchRequest.Builderrescore(java.util.List<Rescore> list)API name:rescoreSearchRequest.Builderrescore(Rescore value, Rescore... values)API name:rescoreSearchRequest.Builderrouting(java.lang.String value)A comma-separated list of specific routing valuesSearchRequest.BuilderruntimeMappings(java.lang.String key, java.util.function.Function<RuntimeField.Builder,ObjectBuilder<RuntimeField>> fn)Defines one or more runtime fields in the search request.SearchRequest.BuilderruntimeMappings(java.lang.String key, RuntimeField value)Defines one or more runtime fields in the search request.SearchRequest.BuilderruntimeMappings(java.util.Map<java.lang.String,RuntimeField> map)Defines one or more runtime fields in the search request.SearchRequest.BuilderscriptFields(java.lang.String key, java.util.function.Function<ScriptField.Builder,ObjectBuilder<ScriptField>> fn)Retrieve a script evaluation (based on different fields) for each hit.SearchRequest.BuilderscriptFields(java.lang.String key, ScriptField value)Retrieve a script evaluation (based on different fields) for each hit.SearchRequest.BuilderscriptFields(java.util.Map<java.lang.String,ScriptField> map)Retrieve a script evaluation (based on different fields) for each hit.SearchRequest.Builderscroll(java.util.function.Function<Time.Builder,ObjectBuilder<Time>> fn)Specify how long a consistent view of the index should be maintained for scrolled searchSearchRequest.Builderscroll(Time value)Specify how long a consistent view of the index should be maintained for scrolled searchSearchRequest.BuildersearchAfter(java.lang.String value, java.lang.String... values)API name:search_afterSearchRequest.BuildersearchAfter(java.util.List<java.lang.String> list)API name:search_afterSearchRequest.BuildersearchType(SearchType value)Search operation typeSearchRequest.BuilderseqNoPrimaryTerm(java.lang.Boolean value)If true, returns sequence number and primary term of the last modification of each hit.SearchRequest.Buildersize(java.lang.Integer value)The number of hits to return.SearchRequest.Builderslice(java.util.function.Function<SlicedScroll.Builder,ObjectBuilder<SlicedScroll>> fn)API name:sliceSearchRequest.Builderslice(SlicedScroll value)API name:sliceSearchRequest.Buildersort(java.util.function.Function<SortOptions.Builder,ObjectBuilder<SortOptions>> fn)API name:sortSearchRequest.Buildersort(java.util.List<SortOptions> list)API name:sortSearchRequest.Buildersort(SortOptions value, SortOptions... values)API name:sortSearchRequest.Buildersource(java.util.function.Function<SourceConfig.Builder,ObjectBuilder<SourceConfig>> fn)Indicates which source fields are returned for matching documents.SearchRequest.Buildersource(SourceConfig value)Indicates which source fields are returned for matching documents.SearchRequest.Builderstats(java.lang.String value, java.lang.String... values)Stats groups to associate with the search.SearchRequest.Builderstats(java.util.List<java.lang.String> list)Stats groups to associate with the search.SearchRequest.BuilderstoredFields(java.lang.String value, java.lang.String... values)List of stored fields to return as part of a hit.SearchRequest.BuilderstoredFields(java.util.List<java.lang.String> list)List of stored fields to return as part of a hit.SearchRequest.Buildersuggest(java.util.function.Function<Suggester.Builder,ObjectBuilder<Suggester>> fn)API name:suggestSearchRequest.Buildersuggest(Suggester value)API name:suggestSearchRequest.BuilderterminateAfter(java.lang.Long value)Maximum number of documents to collect for each shard.SearchRequest.Buildertimeout(java.lang.String value)Specifies the period of time to wait for a response from each shard.SearchRequest.BuildertrackScores(java.lang.Boolean value)If true, calculate and return document scores, even if the scores are not used for sorting.SearchRequest.BuildertrackTotalHits(java.util.function.Function<TrackHits.Builder,ObjectBuilder<TrackHits>> fn)Number of hits matching the query to count accurately.SearchRequest.BuildertrackTotalHits(TrackHits value)Number of hits matching the query to count accurately.SearchRequest.Builderversion(java.lang.Boolean value)If true, returns document version as part of a hit.-
Methods inherited from class org.opensearch.client.util.ObjectBuilderBase
_checkSingleUse, _listAdd, _listAddAll, _mapPut, _mapPutAll
-
-
-
-
Method Detail
-
source
public final SearchRequest.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 SearchRequest.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 SearchRequest.Builder aggregations(java.util.Map<java.lang.String,Aggregation> map)
API name:aggregationsAdds all entries of
maptoaggregations.
-
aggregations
public final SearchRequest.Builder aggregations(java.lang.String key, Aggregation value)
API name:aggregationsAdds an entry to
aggregations.
-
aggregations
public final SearchRequest.Builder aggregations(java.lang.String key, java.util.function.Function<Aggregation.Builder,ObjectBuilder<Aggregation>> fn)
API name:aggregationsAdds an entry to
aggregationsusing a builder lambda.
-
allowNoIndices
public final SearchRequest.Builder allowNoIndices(@Nullable java.lang.Boolean value)
Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes_allstring or when no indices have been specified)API name:
allow_no_indices
-
allowPartialSearchResults
public final SearchRequest.Builder allowPartialSearchResults(@Nullable java.lang.Boolean value)
Indicate if an error should be returned if there is a partial search failure or timeoutAPI name:
allow_partial_search_results
-
analyzeWildcard
public final SearchRequest.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 SearchRequest.Builder analyzer(@Nullable java.lang.String value)
The analyzer to use for the query stringAPI name:
analyzer
-
batchedReduceSize
public final SearchRequest.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 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
public final SearchRequest.Builder ccsMinimizeRoundtrips(@Nullable java.lang.Boolean value)
Indicates whether network round-trips should be minimized as part of cross-cluster search requests executionAPI name:
ccs_minimize_roundtrips
-
collapse
public final SearchRequest.Builder collapse(@Nullable FieldCollapse value)
API name:collapse
-
collapse
public final SearchRequest.Builder collapse(java.util.function.Function<FieldCollapse.Builder,ObjectBuilder<FieldCollapse>> fn)
API name:collapse
-
defaultOperator
public final SearchRequest.Builder defaultOperator(@Nullable Operator value)
The default operator for query string query (AND or OR)API name:
default_operator
-
df
public final SearchRequest.Builder df(@Nullable java.lang.String value)
The field to use as default where no field prefix is given in the query stringAPI name:
df
-
docvalueFields
public final SearchRequest.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_fieldsAdds all elements of
listtodocvalueFields.
-
docvalueFields
public final SearchRequest.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_fieldsAdds one or more values to
docvalueFields.
-
docvalueFields
public final SearchRequest.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_fieldsAdds a value to
docvalueFieldsusing a builder lambda.
-
expandWildcards
public final SearchRequest.Builder expandWildcards(java.util.List<ExpandWildcard> list)
Whether to expand wildcard expression to concrete indices that are open, closed or both.API name:
expand_wildcardsAdds all elements of
listtoexpandWildcards.
-
expandWildcards
public final SearchRequest.Builder expandWildcards(ExpandWildcard value, ExpandWildcard... values)
Whether to expand wildcard expression to concrete indices that are open, closed or both.API name:
expand_wildcardsAdds one or more values to
expandWildcards.
-
explain
public final SearchRequest.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 SearchRequest.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:
fieldsAdds all elements of
listtofields.
-
fields
public final SearchRequest.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:
fieldsAdds one or more values to
fields.
-
fields
public final SearchRequest.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:
fieldsAdds a value to
fieldsusing a builder lambda.
-
from
public final SearchRequest.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 SearchRequest.Builder highlight(@Nullable Highlight value)
API name:highlight
-
highlight
public final SearchRequest.Builder highlight(java.util.function.Function<Highlight.Builder,ObjectBuilder<Highlight>> fn)
API name:highlight
-
ignoreThrottled
public final SearchRequest.Builder ignoreThrottled(@Nullable java.lang.Boolean value)
Whether specified concrete, expanded or aliased indices should be ignored when throttledAPI name:
ignore_throttled
-
ignoreUnavailable
public final SearchRequest.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 SearchRequest.Builder index(java.util.List<java.lang.String> list)
A comma-separated list of index names to search; use_allor empty string to perform the operation on all indicesAPI name:
indexAdds all elements of
listtoindex.
-
index
public final SearchRequest.Builder index(java.lang.String value, java.lang.String... values)
A comma-separated list of index names to search; use_allor empty string to perform the operation on all indicesAPI name:
indexAdds one or more values to
index.
-
indicesBoost
public final SearchRequest.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_boostAdds all elements of
listtoindicesBoost.
-
indicesBoost
public final SearchRequest.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_boostAdds one or more values to
indicesBoost.
-
lenient
public final SearchRequest.Builder lenient(@Nullable java.lang.Boolean value)
Specify whether format-based query failures (such as providing text to a numeric field) should be ignoredAPI name:
lenient
-
maxConcurrentShardRequests
public final SearchRequest.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 requestsAPI name:
max_concurrent_shard_requests
-
minCompatibleShardNode
public final SearchRequest.Builder minCompatibleShardNode(@Nullable java.lang.String value)
The minimum compatible version that all shards involved in search should have for this request to be successfulAPI name:
min_compatible_shard_node
-
minScore
public final SearchRequest.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 SearchRequest.Builder pit(@Nullable Pit pit)
API name:pit
-
postFilter
public final SearchRequest.Builder postFilter(@Nullable Query value)
API name:post_filter
-
postFilter
public final SearchRequest.Builder postFilter(java.util.function.Function<Query.Builder,ObjectBuilder<Query>> fn)
API name:post_filter
-
preFilterShardSize
public final SearchRequest.Builder preFilterShardSize(@Nullable java.lang.Long value)
A threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method ie. if date filters are mandatory to match but the shard bounds and the query are disjoint.API name:
pre_filter_shard_size
-
preference
public final SearchRequest.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 SearchRequest.Builder profile(@Nullable java.lang.Boolean value)
API name:profile
-
q
public final SearchRequest.Builder q(@Nullable java.lang.String value)
Query in the Lucene query string syntaxAPI name:
q
-
query
public final SearchRequest.Builder query(@Nullable Query value)
Defines the search definition using the Query DSL.API name:
query
-
query
public final SearchRequest.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 SearchRequest.Builder requestCache(@Nullable java.lang.Boolean value)
Specify if request cache should be used for this request or not, defaults to index level settingAPI name:
request_cache
-
rescore
public final SearchRequest.Builder rescore(java.util.List<Rescore> list)
API name:rescoreAdds all elements of
listtorescore.
-
rescore
public final SearchRequest.Builder rescore(Rescore value, Rescore... values)
API name:rescoreAdds one or more values to
rescore.
-
rescore
public final SearchRequest.Builder rescore(java.util.function.Function<Rescore.Builder,ObjectBuilder<Rescore>> fn)
API name:rescoreAdds a value to
rescoreusing a builder lambda.
-
routing
public final SearchRequest.Builder routing(@Nullable java.lang.String value)
A comma-separated list of specific routing valuesAPI name:
routing
-
runtimeMappings
public final SearchRequest.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_mappingsAdds all entries of
maptoruntimeMappings.
-
runtimeMappings
public final SearchRequest.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_mappingsAdds an entry to
runtimeMappings.
-
runtimeMappings
public final SearchRequest.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_mappingsAdds an entry to
runtimeMappingsusing a builder lambda.
-
scriptFields
public final SearchRequest.Builder scriptFields(java.util.Map<java.lang.String,ScriptField> map)
Retrieve a script evaluation (based on different fields) for each hit.API name:
script_fieldsAdds all entries of
maptoscriptFields.
-
scriptFields
public final SearchRequest.Builder scriptFields(java.lang.String key, ScriptField value)
Retrieve a script evaluation (based on different fields) for each hit.API name:
script_fieldsAdds an entry to
scriptFields.
-
scriptFields
public final SearchRequest.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_fieldsAdds an entry to
scriptFieldsusing a builder lambda.
-
scroll
public final SearchRequest.Builder scroll(@Nullable Time value)
Specify how long a consistent view of the index should be maintained for scrolled searchAPI name:
scroll
-
scroll
public final SearchRequest.Builder scroll(java.util.function.Function<Time.Builder,ObjectBuilder<Time>> fn)
Specify how long a consistent view of the index should be maintained for scrolled searchAPI name:
scroll
-
searchAfter
public final SearchRequest.Builder searchAfter(java.util.List<java.lang.String> list)
API name:search_afterAdds all elements of
listtosearchAfter.
-
searchAfter
public final SearchRequest.Builder searchAfter(java.lang.String value, java.lang.String... values)
API name:search_afterAdds one or more values to
searchAfter.
-
searchType
public final SearchRequest.Builder searchType(@Nullable SearchType value)
Search operation typeAPI name:
search_type
-
seqNoPrimaryTerm
public final SearchRequest.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 SearchRequest.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 SearchRequest.Builder slice(@Nullable SlicedScroll value)
API name:slice
-
slice
public final SearchRequest.Builder slice(java.util.function.Function<SlicedScroll.Builder,ObjectBuilder<SlicedScroll>> fn)
API name:slice
-
sort
public final SearchRequest.Builder sort(java.util.List<SortOptions> list)
API name:sortAdds all elements of
listtosort.
-
sort
public final SearchRequest.Builder sort(SortOptions value, SortOptions... values)
API name:sortAdds one or more values to
sort.
-
sort
public final SearchRequest.Builder sort(java.util.function.Function<SortOptions.Builder,ObjectBuilder<SortOptions>> fn)
API name:sortAdds a value to
sortusing a builder lambda.
-
stats
public final SearchRequest.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:
statsAdds all elements of
listtostats.
-
stats
public final SearchRequest.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:
statsAdds one or more values to
stats.
-
storedFields
public final SearchRequest.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_fieldsAdds all elements of
listtostoredFields.
-
storedFields
public final SearchRequest.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_fieldsAdds one or more values to
storedFields.
-
suggest
public final SearchRequest.Builder suggest(@Nullable Suggester value)
API name:suggest
-
suggest
public final SearchRequest.Builder suggest(java.util.function.Function<Suggester.Builder,ObjectBuilder<Suggester>> fn)
API name:suggest
-
terminateAfter
public final SearchRequest.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 SearchRequest.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 SearchRequest.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 SearchRequest.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 SearchRequest.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 SearchRequest.Builder version(@Nullable java.lang.Boolean value)
If true, returns document version as part of a hit.API name:
version
-
build
public SearchRequest build()
Builds aSearchRequest.- Specified by:
buildin interfaceObjectBuilder<SearchRequest>- Throws:
java.lang.NullPointerException- if some of the required fields are null.
-
-