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:
CopyableBuilder<TopHitsAggregation.Builder,,TopHitsAggregation> MutableBuilder<TopHitsAggregation.Builder,,TopHitsAggregation> ObjectBuilder<TopHitsAggregation>
- Enclosing class:
TopHitsAggregation
public static class TopHitsAggregation.Builder
extends MetricAggregationBase.AbstractBuilder<TopHitsAggregation.Builder>
implements CopyableBuilder<TopHitsAggregation.Builder,TopHitsAggregation>
Builder for
TopHitsAggregation.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds aTopHitsAggregation.copy()Create a new builderCopyableBuilderthat is a copy of this one.docvalueFields(String value, String... values) API name:docvalue_fieldsdocvalueFields(List<String> list) API name:docvalue_fieldsIftrue, returns detailed information about score computation as part of a hit.Starting document offset.API name:highlightAPI name:highlightReturns the result of one or more script evaluations for each hit.scriptFields(String key, ScriptField value) Returns the result of one or more script evaluations for each hit.scriptFields(Map<String, ScriptField> map) Returns the result of one or more script evaluations for each hit.protected TopHitsAggregation.Builderself()seqNoPrimaryTerm(Boolean value) Iftrue, returns sequence number and primary term of the last modification of each hit.The maximum number of top matching hits to return per bucket.API name:sortsort(List<SortOptions> list) API name:sortsort(SortOptions value, SortOptions... values) API name:sortAPI name:_sourcesource(SourceConfig value) API name:_sourcestoredFields(String value, String... values) API name:stored_fieldsstoredFields(List<String> list) API name:stored_fieldstrackScores(Boolean value) Iftrue, calculates and returns document scores, even if the scores are not used for sorting.Iftrue, returns document version as part of a hit.Methods inherited from class org.opensearch.client.opensearch._types.aggregations.MetricAggregationBase.AbstractBuilder
field, missing, missing, script, scriptMethods inherited from class org.opensearch.client.util.ObjectBuilderBase
_checkSingleUse, _listAdd, _listAddAll, _listCopy, _mapCopy, _mapPut, _mapPutAllMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.opensearch.client.util.MutableBuilder
applyMutation
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
copy
Description copied from interface:CopyableBuilderCreate a new builderCopyableBuilderthat is a copy of this one.- Specified by:
copyin interfaceCopyableBuilder<TopHitsAggregation.Builder,TopHitsAggregation> - Returns:
- a new builder instance.
-
self
- Specified by:
selfin classMetricAggregationBase.AbstractBuilder<TopHitsAggregation.Builder>
-
docvalueFields
API name:docvalue_fieldsAdds all elements of
listtodocvalueFields. -
docvalueFields
API name:docvalue_fieldsAdds one or more values to
docvalueFields. -
explain
Iftrue, returns detailed information about score computation as part of a hit.API name:
explain -
from
Starting document offset.API name:
from -
highlight
API name:highlight -
highlight
@Nonnull public final TopHitsAggregation.Builder highlight(Function<Highlight.Builder, ObjectBuilder<Highlight>> fn) API name:highlight -
scriptFields
Returns the result of one or more script evaluations for each hit.API name:
script_fieldsAdds all elements of
maptoscriptFields. -
scriptFields
Returns the result of one or more script evaluations for each hit.API name:
script_fieldsAdds an entry to
scriptFields. -
scriptFields
@Nonnull public final TopHitsAggregation.Builder scriptFields(String key, Function<ScriptField.Builder, ObjectBuilder<ScriptField>> fn) Returns the result of one or more script evaluations for each hit.API name:
script_fieldsAdds a value to
scriptFieldsusing a builder lambda. -
seqNoPrimaryTerm
Iftrue, returns sequence number and primary term of the last modification of each hit.API name:
seq_no_primary_term -
size
The maximum number of top matching hits to return per bucket.API name:
size -
sort
API name:sortAdds all elements of
listtosort. -
sort
API name:sortAdds one or more values to
sort. -
sort
@Nonnull public final TopHitsAggregation.Builder sort(Function<SortOptions.Builder, ObjectBuilder<SortOptions>> fn) API name:sortAdds a value to
sortusing a builder lambda. -
source
API name:_source -
source
@Nonnull public final TopHitsAggregation.Builder source(Function<SourceConfig.Builder, ObjectBuilder<SourceConfig>> fn) API name:_source -
storedFields
API name:stored_fieldsAdds all elements of
listtostoredFields. -
storedFields
API name:stored_fieldsAdds one or more values to
storedFields. -
trackScores
Iftrue, calculates and returns document scores, even if the scores are not used for sorting.API name:
track_scores -
version
Iftrue, returns document version as part of a hit.API name:
version -
build
Builds aTopHitsAggregation.- Specified by:
buildin interfaceObjectBuilder<TopHitsAggregation>- Throws:
NullPointerException- if some of the required fields are null.
-