Class MultisearchBody.Builder
- All Implemented Interfaces:
WithJson<MultisearchBody.Builder>
,ObjectBuilder<MultisearchBody>
- Enclosing class:
- MultisearchBody
public static class MultisearchBody.Builder extends WithJsonObjectBuilderBase<MultisearchBody.Builder> implements ObjectBuilder<MultisearchBody>
MultisearchBody
.-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
Modifier and Type Method Description MultisearchBody.Builder
aggregations(java.lang.String key, Aggregation value)
API name:aggregations
MultisearchBody.Builder
aggregations(java.lang.String key, java.util.function.Function<Aggregation.Builder,ObjectBuilder<Aggregation>> fn)
API name:aggregations
MultisearchBody.Builder
aggregations(java.util.Map<java.lang.String,Aggregation> map)
API name:aggregations
MultisearchBody
build()
Builds aMultisearchBody
.MultisearchBody.Builder
collapse(FieldCollapse value)
API name:collapse
MultisearchBody.Builder
collapse(java.util.function.Function<FieldCollapse.Builder,ObjectBuilder<FieldCollapse>> fn)
API name:collapse
MultisearchBody.Builder
docvalueFields(FieldAndFormat value, FieldAndFormat... values)
Array of wildcard (*) patterns.MultisearchBody.Builder
docvalueFields(java.util.function.Function<FieldAndFormat.Builder,ObjectBuilder<FieldAndFormat>> fn)
Array of wildcard (*) patterns.MultisearchBody.Builder
docvalueFields(java.util.List<FieldAndFormat> list)
Array of wildcard (*) patterns.MultisearchBody.Builder
explain(java.lang.Boolean value)
If true, returns detailed information about score computation as part of a hit.MultisearchBody.Builder
fields(FieldAndFormat value, FieldAndFormat... values)
Array of wildcard (*) patterns.MultisearchBody.Builder
fields(java.util.function.Function<FieldAndFormat.Builder,ObjectBuilder<FieldAndFormat>> fn)
Array of wildcard (*) patterns.MultisearchBody.Builder
fields(java.util.List<FieldAndFormat> list)
Array of wildcard (*) patterns.MultisearchBody.Builder
from(java.lang.Integer value)
Starting document offset.MultisearchBody.Builder
highlight(Highlight value)
API name:highlight
MultisearchBody.Builder
highlight(java.util.function.Function<Highlight.Builder,ObjectBuilder<Highlight>> fn)
API name:highlight
MultisearchBody.Builder
indicesBoost(java.util.List<java.util.Map<java.lang.String,java.lang.Double>> list)
Boosts the _score of documents from specified indices.MultisearchBody.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.MultisearchBody.Builder
knn(KnnQuery value)
Defines the approximate kNN search to run.MultisearchBody.Builder
knn(java.util.function.Function<KnnQuery.Builder,ObjectBuilder<KnnQuery>> fn)
Defines the approximate kNN search to run.MultisearchBody.Builder
minScore(java.lang.Double value)
Minimum _score for matching documents.MultisearchBody.Builder
pit(PointInTimeReference value)
Limits the search to a point in time (PIT).MultisearchBody.Builder
pit(java.util.function.Function<PointInTimeReference.Builder,ObjectBuilder<PointInTimeReference>> fn)
Limits the search to a point in time (PIT).MultisearchBody.Builder
postFilter(Query value)
API name:post_filter
MultisearchBody.Builder
postFilter(java.util.function.Function<Query.Builder,ObjectBuilder<Query>> fn)
API name:post_filter
MultisearchBody.Builder
profile(java.lang.Boolean value)
API name:profile
MultisearchBody.Builder
query(Query value)
Defines the search definition using the Query DSL.MultisearchBody.Builder
query(java.util.function.Function<Query.Builder,ObjectBuilder<Query>> fn)
Defines the search definition using the Query DSL.MultisearchBody.Builder
rescore(Rescore value, Rescore... values)
API name:rescore
MultisearchBody.Builder
rescore(java.util.function.Function<Rescore.Builder,ObjectBuilder<Rescore>> fn)
API name:rescore
MultisearchBody.Builder
rescore(java.util.List<Rescore> list)
API name:rescore
MultisearchBody.Builder
runtimeMappings(java.lang.String key, java.util.List<RuntimeField> value)
Defines one or more runtime fields in the search request.MultisearchBody.Builder
runtimeMappings(java.util.Map<java.lang.String,java.util.List<RuntimeField>> map)
Defines one or more runtime fields in the search request.MultisearchBody.Builder
scriptFields(java.lang.String key, ScriptField value)
Retrieve a script evaluation (based on different fields) for each hit.MultisearchBody.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.MultisearchBody.Builder
scriptFields(java.util.Map<java.lang.String,ScriptField> map)
Retrieve a script evaluation (based on different fields) for each hit.MultisearchBody.Builder
searchAfter(java.lang.String value, java.lang.String... values)
API name:search_after
MultisearchBody.Builder
searchAfter(java.util.List<java.lang.String> list)
API name:search_after
protected MultisearchBody.Builder
self()
MultisearchBody.Builder
seqNoPrimaryTerm(java.lang.Boolean value)
If true, returns sequence number and primary term of the last modification of each hit.MultisearchBody.Builder
size(java.lang.Integer value)
The number of hits to return.MultisearchBody.Builder
sort(SortOptions value, SortOptions... values)
API name:sort
MultisearchBody.Builder
sort(java.util.function.Function<SortOptions.Builder,ObjectBuilder<SortOptions>> fn)
API name:sort
MultisearchBody.Builder
sort(java.util.List<SortOptions> list)
API name:sort
MultisearchBody.Builder
source(SourceConfig value)
Indicates which source fields are returned for matching documents.MultisearchBody.Builder
source(java.util.function.Function<SourceConfig.Builder,ObjectBuilder<SourceConfig>> fn)
Indicates which source fields are returned for matching documents.MultisearchBody.Builder
stats(java.lang.String value, java.lang.String... values)
Stats groups to associate with the search.MultisearchBody.Builder
stats(java.util.List<java.lang.String> list)
Stats groups to associate with the search.MultisearchBody.Builder
storedFields(java.lang.String value, java.lang.String... values)
List of stored fields to return as part of a hit.MultisearchBody.Builder
storedFields(java.util.List<java.lang.String> list)
List of stored fields to return as part of a hit.MultisearchBody.Builder
suggest(Suggester value)
API name:suggest
MultisearchBody.Builder
suggest(java.util.function.Function<Suggester.Builder,ObjectBuilder<Suggester>> fn)
API name:suggest
MultisearchBody.Builder
terminateAfter(java.lang.Long value)
Maximum number of documents to collect for each shard.MultisearchBody.Builder
timeout(java.lang.String value)
Specifies the period of time to wait for a response from each shard.MultisearchBody.Builder
trackScores(java.lang.Boolean value)
If true, calculate and return document scores, even if the scores are not used for sorting.MultisearchBody.Builder
trackTotalHits(TrackHits value)
Number of hits matching the query to count accurately.MultisearchBody.Builder
trackTotalHits(java.util.function.Function<TrackHits.Builder,ObjectBuilder<TrackHits>> fn)
Number of hits matching the query to count accurately.MultisearchBody.Builder
version(java.lang.Boolean value)
If true, returns document version as part of a hit.Methods inherited from class co.elastic.clients.util.WithJsonObjectBuilderBase
withJson
Methods inherited from class co.elastic.clients.util.ObjectBuilderBase
_checkSingleUse, _listAdd, _listAddAll, _mapPut, _mapPutAll
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
aggregations
public final MultisearchBody.Builder aggregations(java.util.Map<java.lang.String,Aggregation> map)API name:aggregations
Adds all entries of
map
toaggregations
. -
aggregations
API name:aggregations
Adds an entry to
aggregations
. -
aggregations
public final MultisearchBody.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. -
collapse
API name:collapse
-
collapse
public final MultisearchBody.Builder collapse(java.util.function.Function<FieldCollapse.Builder,ObjectBuilder<FieldCollapse>> fn)API name:collapse
-
query
Defines the search definition using the Query DSL.API name:
query
-
query
public final MultisearchBody.Builder query(java.util.function.Function<Query.Builder,ObjectBuilder<Query>> fn)Defines the search definition using the Query DSL.API name:
query
-
explain
If true, returns detailed information about score computation as part of a hit.API name:
explain
-
storedFields
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
tostoredFields
. -
storedFields
public final MultisearchBody.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
. -
docvalueFields
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
todocvalueFields
. -
docvalueFields
public final MultisearchBody.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 MultisearchBody.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. -
knn
Defines the approximate kNN search to run.API name:
knn
-
knn
public final MultisearchBody.Builder knn(java.util.function.Function<KnnQuery.Builder,ObjectBuilder<KnnQuery>> fn)Defines the approximate kNN search to run.API name:
knn
-
from
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
API name:highlight
-
highlight
public final MultisearchBody.Builder highlight(java.util.function.Function<Highlight.Builder,ObjectBuilder<Highlight>> fn)API name:highlight
-
indicesBoost
public final MultisearchBody.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
toindicesBoost
. -
indicesBoost
public final MultisearchBody.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
. -
minScore
Minimum _score for matching documents. Documents with a lower _score are not included in the search results.API name:
min_score
-
postFilter
API name:post_filter
-
postFilter
public final MultisearchBody.Builder postFilter(java.util.function.Function<Query.Builder,ObjectBuilder<Query>> fn)API name:post_filter
-
profile
API name:profile
-
rescore
API name:rescore
Adds all elements of
list
torescore
. -
rescore
API name:rescore
Adds one or more values to
rescore
. -
rescore
public final MultisearchBody.Builder rescore(java.util.function.Function<Rescore.Builder,ObjectBuilder<Rescore>> fn)API name:rescore
Adds a value to
rescore
using a builder lambda. -
scriptFields
public final MultisearchBody.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
toscriptFields
. -
scriptFields
Retrieve a script evaluation (based on different fields) for each hit.API name:
script_fields
Adds an entry to
scriptFields
. -
scriptFields
public final MultisearchBody.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. -
searchAfter
API name:search_after
Adds all elements of
list
tosearchAfter
. -
searchAfter
public final MultisearchBody.Builder searchAfter(java.lang.String value, java.lang.String... values)API name:search_after
Adds one or more values to
searchAfter
. -
size
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
-
sort
API name:sort
Adds all elements of
list
tosort
. -
sort
API name:sort
Adds one or more values to
sort
. -
sort
public final MultisearchBody.Builder sort(java.util.function.Function<SortOptions.Builder,ObjectBuilder<SortOptions>> fn)API name:sort
Adds a value to
sort
using a builder lambda. -
source
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 MultisearchBody.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
-
fields
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
tofields
. -
fields
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 MultisearchBody.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. -
terminateAfter
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
-
stats
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
tostats
. -
stats
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
. -
timeout
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
If true, calculate and return document scores, even if the scores are not used for sorting.API name:
track_scores
-
trackTotalHits
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 MultisearchBody.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
If true, returns document version as part of a hit.API name:
version
-
runtimeMappings
public final MultisearchBody.Builder runtimeMappings(java.util.Map<java.lang.String,java.util.List<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
toruntimeMappings
. -
runtimeMappings
public final MultisearchBody.Builder runtimeMappings(java.lang.String key, java.util.List<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
. -
seqNoPrimaryTerm
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
-
pit
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 MultisearchBody.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
-
suggest
API name:suggest
-
suggest
public final MultisearchBody.Builder suggest(java.util.function.Function<Suggester.Builder,ObjectBuilder<Suggester>> fn)API name:suggest
-
self
- Specified by:
self
in classWithJsonObjectBuilderBase<MultisearchBody.Builder>
-
build
Builds aMultisearchBody
.- Specified by:
build
in interfaceObjectBuilder<MultisearchBody>
- Throws:
java.lang.NullPointerException
- if some of the required fields are null.
-