Class TopHitsAggregation.Builder
- java.lang.Object
-
- org.opensearch.client.util.ObjectBuilderBase
-
- org.opensearch.client.opensearch._types.aggregations.MetricAggregationBase.AbstractBuilder<TopHitsAggregation.Builder>
-
- org.opensearch.client.opensearch._types.aggregations.TopHitsAggregation.Builder
-
- All Implemented Interfaces:
ObjectBuilder<TopHitsAggregation>
- Enclosing class:
- TopHitsAggregation
public static class TopHitsAggregation.Builder extends MetricAggregationBase.AbstractBuilder<TopHitsAggregation.Builder> implements ObjectBuilder<TopHitsAggregation>
Builder forTopHitsAggregation
.
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TopHitsAggregation
build()
Builds aTopHitsAggregation
.TopHitsAggregation.Builder
docvalueFields(java.lang.String value, java.lang.String... values)
API name:docvalue_fields
TopHitsAggregation.Builder
docvalueFields(java.util.List<java.lang.String> list)
API name:docvalue_fields
TopHitsAggregation.Builder
explain(java.lang.Boolean value)
API name:explain
TopHitsAggregation.Builder
from(java.lang.Integer value)
API name:from
TopHitsAggregation.Builder
highlight(java.util.function.Function<Highlight.Builder,ObjectBuilder<Highlight>> fn)
API name:highlight
TopHitsAggregation.Builder
highlight(Highlight value)
API name:highlight
TopHitsAggregation.Builder
scriptFields(java.lang.String key, java.util.function.Function<ScriptField.Builder,ObjectBuilder<ScriptField>> fn)
API name:script_fields
TopHitsAggregation.Builder
scriptFields(java.lang.String key, ScriptField value)
API name:script_fields
TopHitsAggregation.Builder
scriptFields(java.util.Map<java.lang.String,ScriptField> map)
API name:script_fields
protected TopHitsAggregation.Builder
self()
TopHitsAggregation.Builder
seqNoPrimaryTerm(java.lang.Boolean value)
API name:seq_no_primary_term
TopHitsAggregation.Builder
size(java.lang.Integer value)
API name:size
TopHitsAggregation.Builder
sort(java.util.function.Function<SortOptions.Builder,ObjectBuilder<SortOptions>> fn)
API name:sort
TopHitsAggregation.Builder
sort(java.util.List<SortOptions> list)
API name:sort
TopHitsAggregation.Builder
sort(SortOptions value, SortOptions... values)
API name:sort
TopHitsAggregation.Builder
source(java.util.function.Function<SourceConfig.Builder,ObjectBuilder<SourceConfig>> fn)
API name:_source
TopHitsAggregation.Builder
source(SourceConfig value)
API name:_source
TopHitsAggregation.Builder
storedFields(java.lang.String value, java.lang.String... values)
API name:stored_fields
TopHitsAggregation.Builder
storedFields(java.util.List<java.lang.String> list)
API name:stored_fields
TopHitsAggregation.Builder
trackScores(java.lang.Boolean value)
API name:track_scores
TopHitsAggregation.Builder
version(java.lang.Boolean value)
API name:version
-
Methods inherited from class org.opensearch.client.opensearch._types.aggregations.MetricAggregationBase.AbstractBuilder
field, missing, missing, script, script
-
Methods inherited from class org.opensearch.client.util.ObjectBuilderBase
_checkSingleUse, _listAdd, _listAdd, _listAddAll, _listAddAll, _mapPut, _mapPutAll
-
-
-
-
Method Detail
-
docvalueFields
public final TopHitsAggregation.Builder docvalueFields(java.util.List<java.lang.String> list)
API name:docvalue_fields
Adds all elements of
list
todocvalueFields
.
-
docvalueFields
public final TopHitsAggregation.Builder docvalueFields(java.lang.String value, java.lang.String... values)
API name:docvalue_fields
Adds one or more values to
docvalueFields
.
-
explain
public final TopHitsAggregation.Builder explain(@Nullable java.lang.Boolean value)
API name:explain
-
from
public final TopHitsAggregation.Builder from(@Nullable java.lang.Integer value)
API name:from
-
highlight
public final TopHitsAggregation.Builder highlight(@Nullable Highlight value)
API name:highlight
-
highlight
public final TopHitsAggregation.Builder highlight(java.util.function.Function<Highlight.Builder,ObjectBuilder<Highlight>> fn)
API name:highlight
-
scriptFields
public final TopHitsAggregation.Builder scriptFields(java.util.Map<java.lang.String,ScriptField> map)
API name:script_fields
Adds all entries of
map
toscriptFields
.
-
scriptFields
public final TopHitsAggregation.Builder scriptFields(java.lang.String key, ScriptField value)
API name:script_fields
Adds an entry to
scriptFields
.
-
scriptFields
public final TopHitsAggregation.Builder scriptFields(java.lang.String key, java.util.function.Function<ScriptField.Builder,ObjectBuilder<ScriptField>> fn)
API name:script_fields
Adds an entry to
scriptFields
using a builder lambda.
-
size
public final TopHitsAggregation.Builder size(@Nullable java.lang.Integer value)
API name:size
-
sort
public final TopHitsAggregation.Builder sort(java.util.List<SortOptions> list)
API name:sort
Adds all elements of
list
tosort
.
-
sort
public final TopHitsAggregation.Builder sort(SortOptions value, SortOptions... values)
API name:sort
Adds one or more values to
sort
.
-
sort
public final TopHitsAggregation.Builder sort(java.util.function.Function<SortOptions.Builder,ObjectBuilder<SortOptions>> fn)
API name:sort
Adds a value to
sort
using a builder lambda.
-
source
public final TopHitsAggregation.Builder source(@Nullable SourceConfig value)
API name:_source
-
source
public final TopHitsAggregation.Builder source(java.util.function.Function<SourceConfig.Builder,ObjectBuilder<SourceConfig>> fn)
API name:_source
-
storedFields
public final TopHitsAggregation.Builder storedFields(java.util.List<java.lang.String> list)
API name:stored_fields
Adds all elements of
list
tostoredFields
.
-
storedFields
public final TopHitsAggregation.Builder storedFields(java.lang.String value, java.lang.String... values)
API name:stored_fields
Adds one or more values to
storedFields
.
-
trackScores
public final TopHitsAggregation.Builder trackScores(@Nullable java.lang.Boolean value)
API name:track_scores
-
version
public final TopHitsAggregation.Builder version(@Nullable java.lang.Boolean value)
API name:version
-
seqNoPrimaryTerm
public final TopHitsAggregation.Builder seqNoPrimaryTerm(@Nullable java.lang.Boolean value)
API name:seq_no_primary_term
-
self
protected TopHitsAggregation.Builder self()
- Specified by:
self
in classMetricAggregationBase.AbstractBuilder<TopHitsAggregation.Builder>
-
build
public TopHitsAggregation build()
Builds aTopHitsAggregation
.- Specified by:
build
in interfaceObjectBuilder<TopHitsAggregation>
- Throws:
java.lang.NullPointerException
- if some of the required fields are null.
-
-