Class SearchRequestBody
- All Implemented Interfaces:
JsonpSerializable
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final JsonpDeserializer<SearchRequestBody>Json deserializer forSearchRequestBody -
Method Summary
Modifier and TypeMethodDescriptionfinal Map<String,Aggregation> Defines the aggregations that are run as part of the search request.final FieldCollapsecollapse()Collapses search results the values of the specified field.final List<FieldAndFormat>An array of wildcard (*) field patterns.final Booleanexplain()Iftrue, the request returns detailed information about score computation as part of a hit.ext()Configuration of search extensions defined by Elasticsearch plugins.final List<FieldAndFormat>fields()An array of wildcard (*) field patterns.final Integerfrom()The starting document offset, which must be non-negative.final HighlightSpecifies the highlighter to use for retrieving highlighted snippets from one or more fields in your search results.final List<NamedValue<Double>>Boost the_scoreof documents from specified indices.knn()The approximate kNN search to run.final DoubleminScore()The minimum_scorefor matching documents.static SearchRequestBodyfinal PointInTimeReferencepit()Limit the search to a point in time (PIT).final QueryUse thepost_filterparameter to filter search results.final Booleanprofile()Set totrueto return detailed timing information about the execution of individual components in a search request.final Queryquery()The search definition using the Query DSL.final Rankrank()The Reciprocal Rank Fusion (RRF) to use.rescore()Can be used to improve precision by reordering just the top (for example 100 - 500) documents returned by thequeryandpost_filterphases.final RetrieverA retriever is a specification to describe top documents returned from a search.final Map<String,RuntimeField> One or more runtime fields in the search request.final Map<String,ScriptField> Retrieve a script evaluation (based on different fields) for each hit.final List<FieldValue>Used to retrieve the next page of hits using a set of sort values from the previous page.final BooleanIftrue, the request returns sequence number and primary term of the last modification of each hit.voidserialize(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper) Serialize this object to JSON.protected voidserializeInternal(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper) protected static voidfinal Integersize()The number of hits to return, which must not be negative.final SlicedScrollslice()Split a scrolled search into multiple slices that can be consumed independently.final List<SortOptions>sort()A comma-separated list of <field>:<direction> pairs.final SourceConfigsource()The source fields that are returned for matching documents.stats()The stats groups to associate with the search.A comma-separated list of stored fields to return as part of a hit.final Suggestersuggest()Defines a suggester that provides similar looking terms based on a provided text.final LongThe maximum number of documents to collect for each shard.final Stringtimeout()The period of time to wait for a response from each shard.toString()final BooleanIftrue, calculate and return document scores, even if the scores are not used for sorting.final TrackHitsNumber of hits matching the query to count accurately.final Booleanversion()Iftrue, the request returns the document version as part of a hit.
-
Field Details
-
_DESERIALIZER
Json deserializer forSearchRequestBody
-
-
Method Details
-
of
public static SearchRequestBody of(Function<SearchRequestBody.Builder, ObjectBuilder<SearchRequestBody>> fn) -
aggregations
Defines the aggregations that are run as part of the search request.API name:
aggregations -
collapse
Collapses search results the values of the specified field.API name:
collapse -
explain
Iftrue, the request returns detailed information about score computation as part of a hit.API name:
explain -
ext
Configuration of search extensions defined by Elasticsearch plugins.API name:
ext -
from
The starting document offset, which must be non-negative. By default, you cannot page through more than 10,000 hits using thefromandsizeparameters. To page through more hits, use thesearch_afterparameter.API name:
from -
highlight
Specifies the highlighter to use for retrieving highlighted snippets from one or more fields in your search results.API name:
highlight -
trackTotalHits
Number of hits matching the query to count accurately. Iftrue, the exact number of hits is returned at the cost of some performance. Iffalse, the response does not include the total number of hits matching the query.API name:
track_total_hits -
indicesBoost
Boost the_scoreof documents from specified indices. The boost value is the factor by which scores are multiplied. A boost value greater than1.0increases the score. A boost value between0and1.0decreases the score.API name:
indices_boost -
docvalueFields
An array of wildcard (*) field patterns. The request returns doc values for field names matching these patterns in thehits.fieldsproperty of the response.API name:
docvalue_fields -
knn
The approximate kNN search to run.API name:
knn -
rank
The Reciprocal Rank Fusion (RRF) to use.API name:
rank -
minScore
The minimum_scorefor matching documents. Documents with a lower_scoreare not included in search results or results collected by aggregations.API name:
min_score -
postFilter
Use thepost_filterparameter to filter search results. The search hits are filtered after the aggregations are calculated. A post filter has no impact on the aggregation results.API name:
post_filter -
profile
Set totrueto return detailed timing information about the execution of individual components in a search request. NOTE: This is a debugging tool and adds significant overhead to search execution.API name:
profile -
query
The search definition using the Query DSL.API name:
query -
rescore
Can be used to improve precision by reordering just the top (for example 100 - 500) documents returned by thequeryandpost_filterphases.API name:
rescore -
retriever
A retriever is a specification to describe top documents returned from a search. A retriever replaces other elements of the search API that also return top documents such asqueryandknn.API name:
retriever -
scriptFields
Retrieve a script evaluation (based on different fields) for each hit.API name:
script_fields -
searchAfter
Used to retrieve the next page of hits using a set of sort values from the previous page.API name:
search_after -
size
The number of hits to return, which must not be negative. By default, you cannot page through more than 10,000 hits using thefromandsizeparameters. To page through more hits, use thesearch_afterproperty.API name:
size -
slice
Split a scrolled search into multiple slices that can be consumed independently.API name:
slice -
sort
A comma-separated list of <field>:<direction> pairs.API name:
sort -
source
The source fields that are returned for matching documents. These fields are returned in thehits._sourceproperty of the search response. If thestored_fieldsproperty is specified, the_sourceproperty defaults tofalse. Otherwise, it defaults totrue.API name:
_source -
fields
An array of wildcard (*) field patterns. The request returns values for field names matching these patterns in thehits.fieldsproperty of the response.API name:
fields -
suggest
Defines a suggester that provides similar looking terms based on a provided text.API name:
suggest -
terminateAfter
The 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.IMPORTANT: Use with caution. Elasticsearch applies this property to each shard handling the request. When possible, let Elasticsearch perform early termination automatically. Avoid specifying this property for requests that target data streams with backing indices across multiple data tiers.
If set to
0(default), the query does not terminate early.API name:
terminate_after -
timeout
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
Iftrue, calculate and return document scores, even if the scores are not used for sorting.API name:
track_scores -
version
Iftrue, the request returns the document version as part of a hit.API name:
version -
seqNoPrimaryTerm
Iftrue, the request returns sequence number and primary term of the last modification of each hit.API name:
seq_no_primary_term -
storedFields
A comma-separated 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_sourceproperty defaults tofalse. You can pass_source: trueto return both source fields and stored fields in the search response.API name:
stored_fields -
pit
Limit 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 -
runtimeMappings
One or more runtime fields in the search request. These fields take precedence over mapped fields with the same name.API name:
runtime_mappings -
stats
The 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 -
serialize
Serialize this object to JSON.- Specified by:
serializein interfaceJsonpSerializable
-
serializeInternal
-
toString
-
setupSearchRequestBodyDeserializer
protected static void setupSearchRequestBodyDeserializer(ObjectDeserializer<SearchRequestBody.Builder> op)
-