Run a watch
- POST also PUT /_watcher/watch/{id}/_execute
- POST also PUT /_watcher/watch/_execute
This API can be used to force execution of the watch outside of its triggering logic or to simulate the watch execution for debugging purposes.
For testing and debugging purposes, you also have fine-grained control on how the watch runs. You can run the watch without running all of its actions or alternatively by simulating them. You can also force execution by ignoring the watch condition and control whether a watch record would be written to the watch history after it runs.
You can use the run watch API to run watches that are not yet registered by specifying the watch definition inline. This serves as great tool for testing and debugging your watches prior to adding them to Watcher.
When Elasticsearch security features are enabled on your cluster, watches are run with the privileges of the user that stored the watches.
If your user is allowed to read index a, but not index b, then the exact same set of rules will apply during execution of a watch.
When using the run watch API, the authorization data of the user that called the API will be used as a base, instead of the information who stored the watch. Refer to the external documentation for examples of watch execution requests, including existing, customized, and inline watches.
- Cluster privileges:
manage_watcher
Path Parameters
-
idstring Idoptional -
The watch identifier.
Leave it out to use
/_watcher/watch/_execute.
Query Parameters
-
debugboolean · default: false Defines whether the watch runs in debug mode.
Request
-
action_modesmap string to ActionExecutionMode -
Determines how to handle the watch actions as part of the watch execution.
-
alternative_inputmap string to object -
When present, the watch uses this object as a payload instead of executing its own input.
-
ignore_conditionboolean · default: false -
When set to
true, the watch execution uses the always condition. This can also be specified as an HTTP parameter. -
record_executionboolean · default: false -
When set to
true, the watch record representing the watch execution result is persisted to the.watcher-historyindex for the current time. In addition, the status of the watch is updated, possibly throttling subsequent runs. This can also be specified as an HTTP parameter. -
simulated_actionsSimulatedActions -
trigger_dataScheduleTriggerEvent -
This structure is parsed as the data of the trigger event that will be used during the watch execution.
-
scheduled_timeDateTimerequired -
triggered_timeDateTime -
watchWatch · default: null -
When present, this watch is used instead of the one specified in the request. This watch is not persisted to the index and
record_executioncannot be set. -
actionsmap string to Actionrequired -
<string>Action -
action_typeActionType -
Values:
emailwebhookindexloggingslackpagerduty -
conditionConditionContainer -
alwaysAlwaysCondition -
array_comparemap string to ArrayCompareCondition -
<string>ArrayCompareCondition -
pathstringrequired -
comparemap string to string to FieldValue -
neverNeverCondition -
scriptScriptCondition -
langScriptLanguage · default: painless -
Supported values include:
painless: Painless scripting language, purpose-built for Elasticsearch.expression: Lucene’s expressions language, compiles a JavaScript expression to bytecode.mustache: Mustache templated, used for templates.java: Expert Java API
-
Values:
painlessexpressionmustachejava -
paramsmap string to object -
sourceScriptSource -
idstring -
foreachstring -
max_iterationsnumber -
namestring Name -
throttle_periodstring Duration -
throttle_period_in_millisDurationValueUnitMillis -
transformTransformContainer -
chainTransformContainer -
scriptScriptTransform -
searchSearchTransform -
requestSearchInputRequestDefinitionrequired -
bodySearchRequestBody -
aggregationsmap string to AggregationContainer -
Defines the aggregations that are run as part of the search request.
-
collapseFieldCollapse -
Collapses search results the values of the specified field.
-
fieldstring Fieldrequired -
The field to collapse the result set on
-
inner_hitsoneOf -
The number of inner hits and their sort order
-
namestring Name -
The name for the particular inner hit definition in the response. Useful when a search request contains multiple inner hits.
-
sizenumber · default: 3 -
The maximum number of hits to return per
inner_hits. -
fromnumber · default: 0 -
Inner hit starting document offset.
-
collapseFieldCollapse -
docvalue_fieldsFieldAndFormat -
fieldstring Fieldrequired -
A wildcard pattern. The request returns values for field names matching this pattern.
-
formatstring -
The format in which the values are returned.
-
include_unmappedboolean -
explainboolean -
highlightHighlight -
typeHighlighterType -
Supported values include:
plain: Theplainhighlighter uses the standard Lucene highlighterfvh: The fvh highlighter uses the Lucene Fast Vector highlighter.unified: The unified highlighter uses the Lucene Unified Highlighter.
-
Values:
plainfvhunified -
boundary_charsstring · default: .,!? \t\n -
A string that contains each boundary character.
-
boundary_max_scannumber · default: 20 -
How far to scan for boundary characters.
-
boundary_scannerBoundaryScanner -
Specifies how to break the highlighted fragments: chars, sentence, or word. Only valid for the unified and fvh highlighters. Defaults to
sentencefor theunifiedhighlighter. Defaults tocharsfor thefvhhighlighter.Supported values include:
chars: Use the characters specified byboundary_charsas highlighting boundaries. Theboundary_max_scansetting controls how far to scan for boundary characters. Only valid for thefvhhighlighter.sentence: Break highlighted fragments at the next sentence boundary, as determined by Java’sBreakIterator. You can specify the locale to use withboundary_scanner_locale. When used with theunifiedhighlighter, thesentencescanner splits sentences bigger thanfragment_sizeat the first word boundary next to fragment_size. You can setfragment_sizeto0to never split any sentence.word: Break highlighted fragments at the next word boundary, as determined by Java’sBreakIterator. You can specify the locale to use withboundary_scanner_locale.
-
Values:
charssentenceword -
boundary_scanner_localestring · default: Locale.ROOT -
Controls which locale is used to search for sentence and word boundaries. This parameter takes a form of a language tag, for example:
"en-US","fr-FR","ja-JP". -
force_sourcebooleandeprecated -
fragmenterHighlighterFragmenter · default: span -
Specifies how text should be broken up in highlight snippets:
simpleorspan. Only valid for theplainhighlighter. -
Values:
simplespan -
fragment_sizenumber · default: 100 -
The size of the highlighted fragment in characters.
-
highlight_filterboolean -
highlight_queryQueryContainer -
Highlight matches for a query other than the search query. This is especially useful if you use a rescore query because those are not taken into account by highlighting by default.
-
max_fragment_lengthnumber -
max_analyzed_offsetnumber -
If set to a non-negative value, highlighting stops at this defined maximum limit. The rest of the text is not processed, thus not highlighted and no error is returned The
max_analyzed_offsetquery setting does not override theindex.highlight.max_analyzed_offsetsetting, which prevails when it’s set to lower value than the query setting. -
no_match_sizenumber · default: 0 -
The amount of text you want to return from the beginning of the field if there are no matching fragments to highlight.
-
number_of_fragmentsnumber · default: 5 -
The maximum number of fragments to return. If the number of fragments is set to
0, no fragments are returned. Instead, the entire field contents are highlighted and returned. This can be handy when you need to highlight short texts such as a title or address, but fragmentation is not required. Ifnumber_of_fragmentsis0,fragment_sizeis ignored. -
optionsmap string to object -
orderHighlighterOrder · default: none -
Sorts highlighted fragments by score when set to
score. By default, fragments will be output in the order they appear in the field (order:none). Setting this option toscorewill output the most relevant fragments first. Each highlighter applies its own logic to compute relevancy scores. -
Values:
score -
phrase_limitnumber · default: 256 -
Controls the number of matching phrases in a document that are considered. Prevents the
fvhhighlighter from analyzing too many phrases and consuming too much memory. When usingmatched_fields,phrase_limitphrases per matched field are considered. Raising the limit increases query time and consumes more memory. Only supported by thefvhhighlighter. -
Use in conjunction with
pre_tagsto define the HTML tags to use for the highlighted text. By default, highlighted text is wrapped in<em>and</em>tags. -
Use in conjunction with
post_tagsto define the HTML tags to use for the highlighted text. By default, highlighted text is wrapped in<em>and</em>tags. -
require_field_matchboolean · default: true -
By default, only fields that contains a query match are highlighted. Set to
falseto highlight all fields. -
Set to
styledto use the built-in tag schema. -
Values:
styled -
encoderHighlighterEncoder -
Values:
defaulthtml -
fieldsoneOfrequired -
ignore_unmappedboolean -
script_fieldsmap string to ScriptField -
<string>ScriptField -
scriptstring Scriptrequired -
ignore_failureboolean -
seq_no_primary_termboolean -
fieldstring Field -
fieldsFieldAndFormat -
fieldstring Fieldrequired -
A wildcard pattern. The request returns values for field names matching this pattern.
-
formatstring -
The format in which the values are returned.
-
include_unmappedboolean -
sortSort -
How the inner hits should be sorted per
inner_hits. By default, inner hits are sorted by score. -
_sourceSourceConfig -
stored_fieldsstring Fields -
track_scoresboolean · default: false -
versionboolean -
max_concurrent_group_searchesnumber -
The number of concurrent requests allowed to retrieve the inner_hits per group
-
collapseFieldCollapse -
explainboolean · default: false -
If
true, the request returns detailed information about score computation as part of a hit. -
extmap string to object -
Configuration of search extensions defined by Elasticsearch plugins.
-
fromnumber · default: 0 -
The starting document offset, which must be non-negative. By default, you cannot page through more than 10,000 hits using the
fromandsizeparameters. To page through more hits, use thesearch_afterparameter. -
highlightHighlight -
Specifies the highlighter to use for retrieving highlighted snippets from one or more fields in your search results.
- Reference
-
track_total_hitsboolean | number · default: 10000 -
Number of hits matching the query to count accurately. If
true, 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. -
indices_booststring to number -
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. - Reference
-
docvalue_fieldsFieldAndFormat -
An array of wildcard (
*) field patterns. The request returns doc values for field names matching these patterns in thehits.fieldsproperty of the response. - Reference
-
fieldstring Fieldrequired -
A wildcard pattern. The request returns values for field names matching this pattern.
-
formatstring -
The format in which the values are returned.
-
include_unmappedboolean -
knnoneOf -
The approximate kNN search to run.
- Reference
-
fieldstring Fieldrequired -
The name of the vector field to search against
-
query_vectorQueryVector -
The query vector
-
query_vector_builderQueryVectorBuilder -
The query vector builder. You must provide a query_vector_builder or query_vector, but not both.
-
embeddingEmbedding -
inference_idstring -
inputKnnEmbeddingInputrequired -
timeoutstring Duration -
text_embeddingTextEmbedding -
model_idstring -
Model ID is required for all dense_vector fields but may be inferred for semantic_text fields
-
model_textstringrequired -
The text to be converted into a vector by the specified model
-
lookupLookupQueryVectorBuilder -
Lookup a vector from an existing document. Must reference a dense_vector field and a single value.
-
knumber -
The final number of nearest neighbors to return as top hits
-
num_candidatesnumber -
The number of nearest neighbor candidates to consider per shard
-
visit_percentagenumber -
The percentage of vectors to explore per shard while doing knn search with bbq_disk
-
boostnumber -
Boost value to apply to kNN scores
-
filteroneOf -
Filters for the kNN search query
-
similaritynumber -
The minimum similarity for a vector to be considered a match
-
inner_hitsInnerHits -
If defined, each search hit will contain inner hits.
- Reference
-
namestring Name -
The name for the particular inner hit definition in the response. Useful when a search request contains multiple inner hits.
-
sizenumber · default: 3 -
The maximum number of hits to return per
inner_hits. -
fromnumber · default: 0 -
Inner hit starting document offset.
-
collapseFieldCollapse -
fieldstring Fieldrequired -
The field to collapse the result set on
-
inner_hitsoneOf -
The number of inner hits and their sort order
-
max_concurrent_group_searchesnumber -
The number of concurrent requests allowed to retrieve the inner_hits per group
-
collapseFieldCollapse -
docvalue_fieldsFieldAndFormat -
fieldstring Fieldrequired -
A wildcard pattern. The request returns values for field names matching this pattern.
-
formatstring -
The format in which the values are returned.
-
include_unmappedboolean -
explainboolean -
highlightHighlight -
ignore_unmappedboolean -
script_fieldsmap string to ScriptField -
<string>ScriptField -
scriptstring Scriptrequired -
ignore_failureboolean -
seq_no_primary_termboolean -
fieldstring Field -
fieldsFieldAndFormat -
fieldstring Fieldrequired -
A wildcard pattern. The request returns values for field names matching this pattern.
-
formatstring -
The format in which the values are returned.
-
include_unmappedboolean -
sortSort -
How the inner hits should be sorted per
inner_hits. By default, inner hits are sorted by score. -
_sourceSourceConfig -
stored_fieldsstring Fields -
track_scoresboolean · default: false -
versionboolean -
rescore_vectorRescoreVector -
Apply oversampling and rescoring to quantized vectors
-
oversamplenumberrequired -
Applies the specified oversample factor to k on the approximate kNN search
-
_namestring -
rankRankContainer -
The Reciprocal Rank Fusion (RRF) to use.
-
rrfRrfRank -
The reciprocal rank fusion parameters
- Reference
-
rank_constantnumber -
How much influence documents in individual result sets per query have over the final ranked result set
-
rank_window_sizenumber -
Size of the individual result sets per query
-
min_scorenumber -
The minimum
_scorefor matching documents. Documents with a lower_scoreare not included in search results or results collected by aggregations. -
post_filterQueryContainer -
Use the
post_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. -
profileboolean · default: false -
Set to
trueto 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. - Reference
-
queryQueryContainer -
The search definition using the Query DSL.
-
rescoreoneOf -
Can be used to improve precision by reordering just the top (for example 100 - 500) documents returned by the
queryandpost_filterphases. - Reference
-
window_sizenumber -
queryRescoreQuery -
rescore_queryQueryContainerrequired -
The query to use for rescoring. This query is only run on the Top-K results returned by the
queryandpost_filterphases. -
query_weightnumber · default: 1 -
Relative importance of the original query versus the rescore query.
-
rescore_query_weightnumber · default: 1 -
Relative importance of the rescore query versus the original query.
-
score_modeScoreMode · default: total -
Determines how scores are combined.
Supported values include:
avg: Average the original score and the rescore query score.max: Take the max of original score and the rescore query score.min: Take the min of the original score and the rescore query score.multiply: Multiply the original score by the rescore query score. Useful forfunctionquery rescores.total: Add the original score and the rescore query score.
-
Values:
avgmaxminmultiplytotal -
learning_to_rankLearningToRank -
retrieverRetrieverContainer -
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 as
queryandknn. - Reference
-
standardStandardRetriever -
A retriever that replaces the functionality of a traditional query.
-
filteroneOf -
Query to filter the documents that can match.
-
min_scorenumber -
Minimum _score for matching documents. Documents with a lower _score are not included in the top documents.
-
_namestring -
Retriever name.
-
queryQueryContainer -
Defines a query to retrieve a set of top documents.
-
search_afterSortResults -
Defines a search after object parameter used for pagination.
-
terminate_afternumber -
Maximum number of documents to collect for each shard.
-
sortSort -
A sort object that that specifies the order of matching documents.
-
collapseFieldCollapse -
Collapses the top documents by a specified key into a single top document per key.
-
knnKnnRetriever -
A retriever that replaces the functionality of a knn search.
-
filteroneOf -
Query to filter the documents that can match.
-
min_scorenumber -
Minimum _score for matching documents. Documents with a lower _score are not included in the top documents.
-
_namestring -
Retriever name.
-
fieldstringrequired -
The name of the vector field to search against.
-
query_vectorQueryVector -
Query vector. Must have the same number of dimensions as the vector field you are searching against. You must provide a query_vector_builder or query_vector, but not both.
-
query_vector_builderQueryVectorBuilder -
Defines a model to build a query vector.
-
knumberrequired -
Number of nearest neighbors to return as top hits.
-
num_candidatesnumber -
Number of nearest neighbor candidates to consider per shard.
-
visit_percentagenumber -
The percentage of vectors to explore per shard while doing knn search with bbq_disk
-
similaritynumber -
The minimum similarity required for a document to be considered a match.
-
rescore_vectorRescoreVector -
Apply oversampling and rescoring to quantized vectors
-
oversamplenumberrequired -
Applies the specified oversample factor to k on the approximate kNN search
-
rrfRRFRetriever -
A retriever that produces top documents from reciprocal rank fusion (RRF).
-
filteroneOf -
Query to filter the documents that can match.
-
min_scorenumber -
Minimum _score for matching documents. Documents with a lower _score are not included in the top documents.
-
_namestring -
Retriever name.
-
retrieversRRFRetrieverEntryrequired -
A list of child retrievers to specify which sets of returned top documents will have the RRF formula applied to them. Each retriever can optionally include a weight parameter.
-
rank_constantnumber -
This value determines how much influence documents in individual result sets per query have over the final ranked result set.
-
rank_window_sizenumber -
This value determines the size of the individual result sets per query.
-
querystring -
fieldsstring -
text_similarity_rerankerTextSimilarityReranker -
A retriever that reranks the top documents based on a reranking model using the InferenceAPI
-
filteroneOf -
Query to filter the documents that can match.
-
min_scorenumber -
Minimum _score for matching documents. Documents with a lower _score are not included in the top documents.
-
_namestring -
Retriever name.
-
retrieverRetrieverContainerrequired -
The nested retriever which will produce the first-level results, that will later be used for reranking.
-
rank_window_sizenumber -
This value determines how many documents we will consider from the nested retriever.
-
inference_idstring -
Unique identifier of the inference endpoint created using the inference API.
-
inference_textstringrequired -
The text snippet used as the basis for similarity comparison.
-
fieldstringrequired -
The document field to be used for text similarity comparisons. This field should contain the text that will be evaluated against the inference_text.
-
chunk_rescorerChunkRescorer -
Whether to rescore on only the best matching chunks.
-
sizenumber -
The number of chunks per document to evaluate for reranking.
-
chunking_settingsChunkRescorerChunkingSettings -
Chunking settings to apply
-
max_chunk_sizenumber · default: 250required -
The maximum size of a chunk in words. This value cannot be lower than
20(forsentencestrategy) or10(forwordstrategy). This value should not exceed the window size for the associated model. -
overlapnumber · default: 100 -
The number of overlapping words for chunks. It is applicable only to a
wordchunking strategy. This value cannot be higher than half themax_chunk_sizevalue. -
sentence_overlapnumber · default: 1 -
The number of overlapping sentences for chunks. It is applicable only for a
sentencechunking strategy. It can be either1or0. -
separator_groupstring -
Only applicable to the
recursivestrategy and required when using it.Sets a predefined list of separators in the saved chunking settings based on the selected text type. Values can be
markdownorplaintext.Using this parameter is an alternative to manually specifying a custom
separatorslist. -
separatorsstring -
Only applicable to the
recursivestrategy and required when using it.A list of strings used as possible split points when chunking text.
Each string can be a plain string or a regular expression (regex) pattern. The system tries each separator in order to split the text, starting from the first item in the list.
After splitting, it attempts to recombine smaller pieces into larger chunks that stay within the
max_chunk_sizelimit, to reduce the total number of chunks generated. -
ruleRuleRetriever -
A retriever that replaces the functionality of a rule query.
-
filteroneOf -
Query to filter the documents that can match.
-
min_scorenumber -
Minimum _score for matching documents. Documents with a lower _score are not included in the top documents.
-
_namestring -
Retriever name.
-
ruleset_idsId | Idrequired -
The ruleset IDs containing the rules this retriever is evaluating against.
-
match_criteriaobjectrequired -
The match criteria that will determine if a rule in the provided rulesets should be applied.
-
retrieverRetrieverContainerrequired -
The retriever whose results rules should be applied to.
-
rank_window_sizenumber -
This value determines the size of the individual result set.
-
rescorerRescorerRetriever -
A retriever that re-scores only the results produced by its child retriever.
-
linearLinearRetriever -
A retriever that supports the combination of different retrievers through a weighted linear combination.
-
filteroneOf -
Query to filter the documents that can match.
-
min_scorenumber -
Minimum _score for matching documents. Documents with a lower _score are not included in the top documents.
-
_namestring -
Retriever name.
-
retrieversInnerRetriever -
Inner retrievers.
-
retrieverRetrieverContainerrequired -
The nested retriever configuration.
-
weightnumber · default: 1 -
Weight multiplier for this retriever's contribution to the linear combination. Must be non-negative.
-
normalizerScoreNormalizer · default: none -
Score normalizer to apply to this retriever's results before weighting. Falls back to the top-level
normalizeron the linear retriever if unset, then tonone(identity) if neither is set. -
Values:
noneminmaxl2_norm -
rank_window_sizenumber -
querystring -
fieldsstring -
normalizerScoreNormalizer -
Values:
noneminmaxl2_norm -
pinnedPinnedRetriever -
A pinned retriever applies pinned documents to the underlying retriever. This retriever will rewrite to a PinnedQueryBuilder.
-
filteroneOf -
Query to filter the documents that can match.
-
min_scorenumber -
Minimum _score for matching documents. Documents with a lower _score are not included in the top documents.
-
_namestring -
Retriever name.
-
retrieverRetrieverContainerrequired -
Inner retriever.
-
idsstring -
rank_window_sizenumber -
diversifyDiversifyRetriever -
A retriever that diversifies the results from its child retriever.
-
filteroneOf -
Query to filter the documents that can match.
-
min_scorenumber -
Minimum _score for matching documents. Documents with a lower _score are not included in the top documents.
-
_namestring -
Retriever name.
-
fieldstringrequired -
The document field on which to diversify results on.
-
retrieverRetrieverContainerrequired -
The nested retriever whose results will be diversified.
-
sizenumber -
The number of top documents to return after diversification.
-
rank_window_sizenumber -
The number of top documents from the nested retriever to consider for diversification.
-
query_vectorQueryVector -
The query vector used for diversification.
-
query_vector_builderQueryVectorBuilder -
a dense vector query vector builder to use instead of a static query_vector
-
lambdanumber -
Controls the trade-off between relevance and diversity for MMR. A value of 0.0 focuses solely on diversity, while a value of 1.0 focuses solely on relevance. Required for MMR
-
script_fieldsmap string to ScriptField -
Retrieve a script evaluation (based on different fields) for each hit.
-
<string>ScriptField -
scriptstring Scriptrequired -
ignore_failureboolean -
search_afterSortResults -
Used to retrieve the next page of hits using a set of sort values from the previous page.
- Reference
-
sizenumber · default: 10 -
The number of hits to return, which must not be negative. By default, you cannot page through more than 10,000 hits using the
fromandsizeparameters. To page through more hits, use thesearch_afterproperty. -
sliceSlicedScroll -
Split a scrolled search into multiple slices that can be consumed independently.
- Reference
-
_sourceSourceConfig -
The source fields that are returned for matching documents. These fields are returned in the
hits._sourceproperty of the search response. If thestored_fieldsproperty is specified, the_sourceproperty defaults tofalse. Otherwise, it defaults totrue. - Reference
-
fieldsFieldAndFormat -
An array of wildcard (
*) field patterns. The request returns values for field names matching these patterns in thehits.fieldsproperty of the response. -
fieldstring Fieldrequired -
A wildcard pattern. The request returns values for field names matching this pattern.
-
formatstring -
The format in which the values are returned.
-
include_unmappedboolean -
suggestSuggester -
Defines a suggester that provides similar looking terms based on a provided text.
- Reference
-
textstring -
Global suggest text, to avoid repetition when the same text is used in several suggesters
-
terminate_afternumber · default: 0 -
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. -
timeoutstring -
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.
-
track_scoresboolean · default: false -
If
true, calculate and return document scores, even if the scores are not used for sorting. -
versionboolean · default: false -
If
true, the request returns the document version as part of a hit. -
seq_no_primary_termboolean -
If
true, the request returns sequence number and primary term of the last modification of each hit. - Reference
-
stored_fieldsstring Fields -
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. - Reference
-
pitPointInTimeReference -
Limit the search to a point in time (PIT). If you provide a PIT, you cannot specify an
<index>in the request path. -
idstring Idrequired -
keep_alivestring Duration -
runtime_mappingsRuntimeFields -
One or more runtime fields in the search request. These fields take precedence over mapped fields with the same name.
- Reference
-
statsstring -
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.
-
indicesstring Indices -
indices_optionsIndicesOptions -
allow_no_indicesboolean -
A setting that does two separate checks on the index expression. If
false, the request returns an error (1) if any wildcard expression (including_alland*) resolves to zero matching indices or (2) if the complete set of resolved indices, aliases or data streams is empty after all expressions are evaluated. Iftrue, index expressions that resolve to no indices are allowed and the request returns an empty result. -
expand_wildcardsstring ExpandWildcards -
Type of index that wildcard patterns can match. If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. Supports comma-separated values, such as
open,hidden.Supported values include:
all: Match any data stream or index, including hidden ones.open: Match open, non-hidden indices. Also matches any non-hidden data stream.closed: Match closed, non-hidden indices. Also matches any non-hidden data stream. Data streams cannot be closed.hidden: Match hidden data streams and hidden indices. Must be combined withopen,closed, orboth.none: Wildcard expressions are not accepted.
-
Values:
allopenclosedhiddennone -
If
false, the request returns an error if it targets a concrete (non-wildcarded) index, alias, or data stream that is missing, closed, or otherwise unavailable. Iftrue, unavailable concrete targets are silently ignored. -
ignore_throttledboolean · default: true -
If true, concrete, expanded or aliased indices are ignored when frozen.
-
search_typeSearchType -
Supported values include:
query_then_fetch: Documents are scored using local term and document frequencies for the shard. This is usually faster but less accurate.dfs_query_then_fetch: Documents are scored using global term and document frequencies across all shards. This is usually slower but more accurate.
-
Values:
query_then_fetchdfs_query_then_fetch -
templateSearchTemplateRequestBody -
explainboolean · default: false -
idstring Id -
ID of the search template to use. If no source is specified, this parameter is required.
-
langScriptLanguage · default: mustache -
The language the template is written in. It is reported in the resolved search input of a watch record.
Supported values include:
painless: Painless scripting language, purpose-built for Elasticsearch.expression: Lucene’s expressions language, compiles a JavaScript expression to bytecode.mustache: Mustache templated, used for templates.java: Expert Java API
-
Values:
painlessexpressionmustachejava -
paramsmap string to object -
profileboolean · default: false -
sourcestring -
An inline search template. Supports the same parameters as the search API's request body. Also supports Mustache variables. If no id is specified, this parameter is required.
-
rest_total_hits_as_intboolean -
timeoutstring Duration -
indexIndexAction -
indexstring IndexName -
doc_idstring Id -
refreshRefresh -
Values:
truefalsewait_for -
op_typeOpType · default: index -
Supported values include:
index: Overwrite any documents that already exist.create: Only index documents that do not already exist.
-
Values:
indexcreate -
timeoutstring Duration · default: 60s -
execution_time_fieldstring Field -
emailEmailAction -
idstring Id -
bccstring | string -
ccstring | string -
fromstring -
priorityEmailPriority -
Values:
lowestlownormalhighhighest -
reply_tostring | string -
sent_dateDateTime -
subjectstringrequired -
tostring | stringrequired -
attachmentsmap string to EmailAttachmentContainer -
<string>EmailAttachmentContainer -
httpHttpEmailAttachment -
content_typestring -
inlineboolean -
requestHttpInputRequestDefinition -
authHttpInputAuthentication -
bodystring -
connection_timeoutstring Duration -
headersmap string to string -
hoststring -
methodHttpInputMethod -
Values:
headgetpostputdelete -
paramsmap string to string -
pathstring -
portnumber uint -
read_timeoutstring Duration -
schemeConnectionScheme -
Values:
httphttps -
urlstring -
reportingReportingEmailAttachment -
pagerdutyPagerDutyAction -
accountstring -
attach_payloadbooleanrequired -
clientstring -
client_urlstring -
contextsPagerDutyContext -
descriptionstringrequired -
event_typePagerDutyEventType · default: trigger -
Values:
triggerresolveacknowledge -
incident_keystringrequired -
slackSlackAction -
accountstring -
messageSlackMessagerequired -
attachmentsSlackAttachmentrequired -
dynamic_attachmentsSlackDynamicAttachment -
attachment_templateSlackAttachmentrequired -
list_pathstringrequired -
fromstringrequired -
iconstring -
textstringrequired -
tostringrequired -
webhookWebhookAction -
authHttpInputAuthentication -
bodystring -
connection_timeoutstring Duration -
headersmap string to string -
hoststring -
methodHttpInputMethod -
Values:
headgetpostputdelete -
paramsmap string to string -
pathstring -
portnumber uint -
read_timeoutstring Duration -
schemeConnectionScheme -
Values:
httphttps -
urlstring -
conditionConditionContainer -
inputInputContainerrequired -
httpHttpInput -
extractstring -
requestHttpInputRequestDefinition -
response_content_typeResponseContentType -
Values:
jsonyamltext -
searchSearchInput -
extractstring -
requestSearchInputRequestDefinitionrequired -
bodySearchRequestBody -
aggregationsmap string to AggregationContainer -
Defines the aggregations that are run as part of the search request.
-
collapseFieldCollapse -
Collapses search results the values of the specified field.
-
explainboolean · default: false -
If
true, the request returns detailed information about score computation as part of a hit. -
extmap string to object -
Configuration of search extensions defined by Elasticsearch plugins.
-
fromnumber · default: 0 -
The starting document offset, which must be non-negative. By default, you cannot page through more than 10,000 hits using the
fromandsizeparameters. To page through more hits, use thesearch_afterparameter. -
highlightHighlight -
Specifies the highlighter to use for retrieving highlighted snippets from one or more fields in your search results.
- Reference
-
track_total_hitsboolean | number · default: 10000 -
Number of hits matching the query to count accurately. If
true, 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. -
indices_booststring to number -
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. - Reference
-
docvalue_fieldsFieldAndFormat -
An array of wildcard (
*) field patterns. The request returns doc values for field names matching these patterns in thehits.fieldsproperty of the response. - Reference
-
fieldstring Fieldrequired -
A wildcard pattern. The request returns values for field names matching this pattern.
-
formatstring -
The format in which the values are returned.
-
include_unmappedboolean -
rankRankContainer -
The Reciprocal Rank Fusion (RRF) to use.
-
rrfRrfRank -
The reciprocal rank fusion parameters
- Reference
-
rank_constantnumber -
How much influence documents in individual result sets per query have over the final ranked result set
-
rank_window_sizenumber -
Size of the individual result sets per query
-
min_scorenumber -
The minimum
_scorefor matching documents. Documents with a lower_scoreare not included in search results or results collected by aggregations. -
post_filterQueryContainer -
Use the
post_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. -
profileboolean · default: false -
Set to
trueto 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. - Reference
-
queryQueryContainer -
The search definition using the Query DSL.
-
rescoreoneOf -
Can be used to improve precision by reordering just the top (for example 100 - 500) documents returned by the
queryandpost_filterphases. - Reference
-
retrieverRetrieverContainer -
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 as
queryandknn. - Reference
-
script_fieldsmap string to ScriptField -
Retrieve a script evaluation (based on different fields) for each hit.
-
<string>ScriptField -
scriptstring Scriptrequired -
ignore_failureboolean -
search_afterSortResults -
Used to retrieve the next page of hits using a set of sort values from the previous page.
- Reference
-
sizenumber · default: 10 -
The number of hits to return, which must not be negative. By default, you cannot page through more than 10,000 hits using the
fromandsizeparameters. To page through more hits, use thesearch_afterproperty. -
sliceSlicedScroll -
Split a scrolled search into multiple slices that can be consumed independently.
- Reference
-
_sourceSourceConfig -
The source fields that are returned for matching documents. These fields are returned in the
hits._sourceproperty of the search response. If thestored_fieldsproperty is specified, the_sourceproperty defaults tofalse. Otherwise, it defaults totrue. - Reference
-
fieldsFieldAndFormat -
An array of wildcard (
*) field patterns. The request returns values for field names matching these patterns in thehits.fieldsproperty of the response. -
fieldstring Fieldrequired -
A wildcard pattern. The request returns values for field names matching this pattern.
-
formatstring -
The format in which the values are returned.
-
include_unmappedboolean -
suggestSuggester -
Defines a suggester that provides similar looking terms based on a provided text.
- Reference
-
textstring -
Global suggest text, to avoid repetition when the same text is used in several suggesters
-
terminate_afternumber · default: 0 -
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. -
timeoutstring -
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.
-
track_scoresboolean · default: false -
If
true, calculate and return document scores, even if the scores are not used for sorting. -
versionboolean · default: false -
If
true, the request returns the document version as part of a hit. -
seq_no_primary_termboolean -
If
true, the request returns sequence number and primary term of the last modification of each hit. - Reference
-
stored_fieldsstring Fields -
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. - Reference
-
pitPointInTimeReference -
Limit the search to a point in time (PIT). If you provide a PIT, you cannot specify an
<index>in the request path. -
idstring Idrequired -
keep_alivestring Duration -
runtime_mappingsRuntimeFields -
One or more runtime fields in the search request. These fields take precedence over mapped fields with the same name.
- Reference
-
statsstring -
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.
-
indicesstring Indices -
indices_optionsIndicesOptions -
allow_no_indicesboolean -
A setting that does two separate checks on the index expression. If
false, the request returns an error (1) if any wildcard expression (including_alland*) resolves to zero matching indices or (2) if the complete set of resolved indices, aliases or data streams is empty after all expressions are evaluated. Iftrue, index expressions that resolve to no indices are allowed and the request returns an empty result. -
expand_wildcardsstring ExpandWildcards -
Type of index that wildcard patterns can match. If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. Supports comma-separated values, such as
open,hidden.Supported values include:
all: Match any data stream or index, including hidden ones.open: Match open, non-hidden indices. Also matches any non-hidden data stream.closed: Match closed, non-hidden indices. Also matches any non-hidden data stream. Data streams cannot be closed.hidden: Match hidden data streams and hidden indices. Must be combined withopen,closed, orboth.none: Wildcard expressions are not accepted.
-
Values:
allopenclosedhiddennone -
If
false, the request returns an error if it targets a concrete (non-wildcarded) index, alias, or data stream that is missing, closed, or otherwise unavailable. Iftrue, unavailable concrete targets are silently ignored. -
ignore_throttledboolean · default: true -
If true, concrete, expanded or aliased indices are ignored when frozen.
-
search_typeSearchType -
Supported values include:
query_then_fetch: Documents are scored using local term and document frequencies for the shard. This is usually faster but less accurate.dfs_query_then_fetch: Documents are scored using global term and document frequencies across all shards. This is usually slower but more accurate.
-
Values:
query_then_fetchdfs_query_then_fetch -
templateSearchTemplateRequestBody -
explainboolean · default: false -
idstring Id -
ID of the search template to use. If no source is specified, this parameter is required.
-
langScriptLanguage · default: mustache -
The language the template is written in. It is reported in the resolved search input of a watch record.
Supported values include:
painless: Painless scripting language, purpose-built for Elasticsearch.expression: Lucene’s expressions language, compiles a JavaScript expression to bytecode.mustache: Mustache templated, used for templates.java: Expert Java API
-
Values:
painlessexpressionmustachejava -
paramsmap string to object -
profileboolean · default: false -
sourcestring -
An inline search template. Supports the same parameters as the search API's request body. Also supports Mustache variables. If no id is specified, this parameter is required.
-
rest_total_hits_as_intboolean -
timeoutstring Duration -
simplemap string to object -
metadataMetadata -
statusWatchStatus -
actionsActionsrequired -
last_checkedDateTime -
last_met_conditionDateTime -
versionnumber VersionNumberrequired -
execution_statestring -
throttle_periodstring Duration -
throttle_period_in_millisDurationValueUnitMillis -
transformTransformContainer -
triggerTriggerContainerrequired
Response
-
_idstring Idrequired -
The watch record identifier as it would be stored in the
.watcher-historyindex. -
watch_recordWatchRecordrequired -
The watch record document as it would be stored in the
.watcher-historyindex. -
@timestampDateTimerequired -
nodestringrequired -
stateExecutionStatusrequired -
Values:
awaits_executioncheckingexecution_not_neededthrottledexecutedfaileddeleted_while_queuednot_executed_already_queued -
trigger_eventTriggerEventResultrequired -
manualTriggerEventContainerrequired -
scheduleScheduleTriggerEvent -
scheduled_timeDateTimerequired -
triggered_timeDateTime -
triggered_timeDateTimerequired -
typestringrequired -
watch_idstring Idrequired -
conditionConditionContainer -
inputInputContainer -
metadataMetadata -
resultExecutionResult -
actionsExecutionResultActionrequired -
emailEmailResult -
accountstring -
messageEmailrequired -
idstring Id -
bccstring | string -
ccstring | string -
fromstring -
priorityEmailPriority -
Values:
lowestlownormalhighhighest -
reply_tostring | string -
sent_dateDateTime -
subjectstringrequired -
tostring | stringrequired -
attachmentsmap string to EmailAttachmentContainer -
<string>EmailAttachmentContainer -
reasonstring -
indexIndexResult -
responseoneOf -
The outcome of the index operation. A single summary is returned when a single document is indexed, or an array when several documents are indexed at once. When a bulk operation ends in
failureorpartial_failure, the array includes failed items. -
loggingLoggingResult -
logged_textstringrequired -
pagerdutyPagerDutyResult -
eventPagerDutyEventrequired -
accountstring -
attach_payloadbooleanrequired -
clientstring -
client_urlstring -
contextsPagerDutyContext -
descriptionstringrequired -
event_typePagerDutyEventType · default: trigger -
Values:
triggerresolveacknowledge -
incident_keystringrequired -
reasonstring -
requestHttpInputRequestResult -
authHttpInputAuthentication -
bodystring -
connection_timeoutstring Duration -
headersmap string to string -
hoststring -
methodHttpInputMethod -
Values:
headgetpostputdelete -
paramsmap string to string -
pathstring -
portnumber uint -
read_timeoutstring Duration -
schemeConnectionScheme -
Values:
httphttps -
urlstring -
webhookWebhookResult -
errorErrorCause -
typestringrequired -
The type of error
-
reasonstringnullable -
A human-readable explanation of the error, in English.
-
stack_tracestring -
The server stack trace. Present only if the
error_trace=trueparameter was sent with the request. -
caused_byErrorCause -
root_causeErrorCause -
suppressedErrorCause -
reasonstring -
idstring Idrequired -
typeActionTyperequired -
Values:
emailwebhookindexloggingslackpagerduty -
statusActionStatusOptionsrequired -
Values:
successfailurepartial_failureacknowledgedthrottledcondition_failedsimulated -
conditionExecutionResultCondition -
metbooleanrequired -
statusExecutionResultStatusrequired -
Values:
successfailure -
typeConditionTyperequired -
Values:
alwaysneverscriptcomparearray_compare -
compareExecutionResultConditionResolved -
resolved_valuesmap string to object -
array_compareExecutionResultConditionResolved -
resolved_valuesmap string to object -
transformExecutionResultTransform -
payloadmap string to object -
statusExecutionResultStatusrequired -
Values:
successfailure -
typeExecutionResultTransformTyperequired -
Values:
scriptsearchchain -
errorErrorCause -
typestringrequired -
The type of error
-
reasonstringnullable -
A human-readable explanation of the error, in English.
-
stack_tracestring -
The server stack trace. Present only if the
error_trace=trueparameter was sent with the request. -
caused_byErrorCause -
root_causeErrorCause -
suppressedErrorCause -
reasonstring -
foreachExecutionResultForeachAction -
emailEmailResult -
indexIndexResult -
loggingLoggingResult -
logged_textstringrequired -
pagerdutyPagerDutyResult -
webhookWebhookResult -
errorErrorCause -
typestringrequired -
The type of error
-
reasonstringnullable -
A human-readable explanation of the error, in English.
-
stack_tracestring -
The server stack trace. Present only if the
error_trace=trueparameter was sent with the request. -
caused_byErrorCause -
root_causeErrorCause -
suppressedErrorCause -
reasonstring -
max_iterationsnumber -
number_of_actions_executednumber -
conditionExecutionResultCondition -
metbooleanrequired -
statusExecutionResultStatusrequired -
Values:
successfailure -
typeConditionTyperequired -
Values:
alwaysneverscriptcomparearray_compare -
compareExecutionResultConditionResolved -
resolved_valuesmap string to object -
array_compareExecutionResultConditionResolved -
resolved_valuesmap string to object -
execution_durationDurationValueUnitMillisrequired -
execution_timeDateTimerequired -
inputExecutionResultInput -
payloadmap string to object -
statusExecutionResultStatusrequired -
Values:
successfailure -
typeInputTyperequired -
Values:
chainhttpnonesearchsimpletransform -
searchExecutionResultSearchInput -
The resolved search request, present when the input is a search input.
-
requestSearchInputRequestDefinitionrequired -
httpExecutionResultHttpInput -
The resolved HTTP request, present when the input is an HTTP input.
-
requestHttpInputRequestResultrequired -
status_codenumber -
The HTTP status code returned by the request. It is only present when the request was executed.
-
chainmap string to ExecutionResultInput -
The result of each named input, present when the input is a chain input.
-
errorErrorCause -
typestringrequired -
The type of error
-
reasonstringnullable -
A human-readable explanation of the error, in English.
-
stack_tracestring -
The server stack trace. Present only if the
error_trace=trueparameter was sent with the request. -
caused_byErrorCause -
root_causeErrorCause -
suppressedErrorCause -
transformExecutionResultTransform -
userstring -
statusWatchStatus -
actionsActionsrequired -
last_checkedDateTime -
last_met_conditionDateTime -
versionnumber VersionNumberrequired -
execution_statestring -
messagesstring -
varsmap string to object -
exceptionErrorCause -
typestringrequired -
The type of error
-
reasonstringnullable -
A human-readable explanation of the error, in English.
-
stack_tracestring -
The server stack trace. Present only if the
error_trace=trueparameter was sent with the request. -
caused_byErrorCause -
root_causeErrorCause -
suppressedErrorCause