Class TopHitsAggregation.Builder
- All Implemented Interfaces:
WithJson<TopHitsAggregation.Builder>,ObjectBuilder<TopHitsAggregation>
- Enclosing class:
- TopHitsAggregation
TopHitsAggregation.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds aTopHitsAggregation.docvalueFields(String value, String... values) Fields for which to return doc values.docvalueFields(List<String> list) Fields for which to return doc values.Iftrue, returns detailed information about score computation as part of a hit.Starting document offset.Specifies the highlighter to use for retrieving highlighted snippets from one or more fields in the search results.Specifies the highlighter to use for retrieving highlighted snippets from one or more fields in the search results.scriptFields(String key, ScriptField value) Returns the result of one or more script evaluations for each hit.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.sort(SortOptions value, SortOptions... values) Sort order of the top matching hits.Sort order of the top matching hits.sort(List<SortOptions> list) Sort order of the top matching hits.source(SourceConfig value) Selects the fields of the source that are returned.Selects the fields of the source that are returned.storedFields(String value, String... values) Returns values for the specified stored fields (fields that use thestoremapping option).storedFields(List<String> list) Returns values for the specified stored fields (fields that use thestoremapping option).trackScores(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 co.elastic.clients.elasticsearch._types.aggregations.MetricAggregationBase.AbstractBuilder
field, missing, missing, missing, missing, missing, missing, script, scriptMethods inherited from class co.elastic.clients.util.WithJsonObjectBuilderBase
withJsonMethods inherited from class co.elastic.clients.util.ObjectBuilderBase
_checkSingleUse, _listAdd, _listAddAll, _mapPut, _mapPutAll
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
docvalueFields
Fields for which to return doc values.API name:
docvalue_fieldsAdds all elements of
listtodocvalueFields. -
docvalueFields
Fields for which to return doc values.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
Specifies the highlighter to use for retrieving highlighted snippets from one or more fields in the search results.API name:
highlight -
highlight
public final TopHitsAggregation.Builder highlight(Function<Highlight.Builder, ObjectBuilder<Highlight>> fn) Specifies the highlighter to use for retrieving highlighted snippets from one or more fields in the search results.API name:
highlight -
scriptFields
Returns the result of one or more script evaluations for each hit.API name:
script_fieldsAdds all entries of
maptoscriptFields. -
scriptFields
Returns the result of one or more script evaluations for each hit.API name:
script_fieldsAdds an entry to
scriptFields. -
scriptFields
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 an entry to
scriptFieldsusing a builder lambda. -
size
The maximum number of top matching hits to return per bucket.API name:
size -
sort
Sort order of the top matching hits. By default, the hits are sorted by the score of the main query.API name:
sortAdds all elements of
listtosort. -
sort
Sort order of the top matching hits. By default, the hits are sorted by the score of the main query.API name:
sortAdds one or more values to
sort. -
sort
public final TopHitsAggregation.Builder sort(Function<SortOptions.Builder, ObjectBuilder<SortOptions>> fn) Sort order of the top matching hits. By default, the hits are sorted by the score of the main query.API name:
sortAdds a value to
sortusing a builder lambda. -
source
Selects the fields of the source that are returned.API name:
_source -
source
public final TopHitsAggregation.Builder source(Function<SourceConfig.Builder, ObjectBuilder<SourceConfig>> fn) Selects the fields of the source that are returned.API name:
_source -
storedFields
Returns values for the specified stored fields (fields that use thestoremapping option).API name:
stored_fieldsAdds all elements of
listtostoredFields. -
storedFields
Returns values for the specified stored fields (fields that use thestoremapping option).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 -
seqNoPrimaryTerm
Iftrue, returns sequence number and primary term of the last modification of each hit.API name:
seq_no_primary_term -
self
- Specified by:
selfin classMetricAggregationBase.AbstractBuilder<TopHitsAggregation.Builder>
-
build
Builds aTopHitsAggregation.- Specified by:
buildin interfaceObjectBuilder<TopHitsAggregation>- Throws:
NullPointerException- if some of the required fields are null.
-