Menu
Search (GET /_search)
Search
/_searchUse it in a workflow
- Add a step and choose the OpenSearch connector.
- Pick the Search (GET /_search) action (under core).
- Fill in the fields below, then reference the result from later steps as
{{searchGetSearch.response.data}}.
Request
Query parameters
_sourceoneOfIndicates which source fields are returned for matching documents. These fields are returned in the `hits._source` property of the search response. Valid values are: `true` to return the entire document source; `false` to not return the document source; `<string>` to return the source fields that are specified as a comma-separated list (supports wildcard (`*`) patterns).
_source_excludesoneOfA comma-separated list of source fields to exclude from the response. You can also use this parameter to exclude fields from the subset specified in `_source_includes` query parameter. If the `_source` parameter is `false`, this parameter is ignored.
_source_includesoneOfA comma-separated list of source fields to include in the response. If this parameter is specified, only these source fields are returned. You can exclude fields from this subset using the `_source_excludes` query parameter. If the `_source` parameter is `false`, this parameter is ignored.
allow_no_indicesbooleanIf `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indexes. This behavior applies even if the request targets other open indexes. For example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`.
allow_partial_search_resultsbooleanIf `true`, returns partial results if there are shard request timeouts or shard failures. If `false`, returns an error with no partial results.
Default true
analyze_wildcardbooleanIf `true`, wildcard and prefix queries are analyzed. This parameter can only be used when the q query string parameter is specified.
Default false
analyzerstringAnalyzer to use for the query string. This parameter can only be used when the q query string parameter is specified.
batched_reduce_sizeinteger (int32)The number of shard results that should be reduced at once on the coordinating node. This value should be used as a protection mechanism to reduce the memory overhead per search request if the potential number of shards in the request can be large.
Default 512
cancel_after_time_intervalstringThe time after which the search request will be canceled. Request-level parameter takes precedence over `cancel_after_time_interval` cluster setting.
ccs_minimize_roundtripsbooleanIf `true`, network round-trips between the coordinating node and the remote clusters are minimized when executing cross-cluster search (CCS) requests.
Default true
default_operatorstringThe default operator for query string query: AND or OR. This parameter can only be used when the `q` query string parameter is specified.
dfstringField to use as default where no field prefix is given in the query string. This parameter can only be used when the q query string parameter is specified.
docvalue_fieldsoneOfA comma-separated list of fields to return as the docvalue representation for each hit.
expand_wildcardsoneOfType 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`.
explainbooleanIf `true`, returns detailed information about score computation as part of a hit.
frominteger (int32)Starting document offset. Needs to be non-negative. By default, you cannot page through more than 10,000 hits using the `from` and `size` parameters. To page through more hits, use the `search_after` parameter.
Default 0
ignore_throttledbooleanIf `true`, concrete, expanded or aliased indexes will be ignored when frozen.
ignore_unavailablebooleanIf `false`, the request returns an error if it targets a missing or closed index.
include_named_queries_scorebooleanIndicates whether `hit.matched_queries` should be rendered as a map that includes the name of the matched query associated with its score (true) or as an array containing the name of the matched queries (false)
Default false
indexoneOfA comma-separated list of data streams, indexes, and aliases to search. Supports wildcards (`*`). To search all data streams and indexes, omit this parameter or use `*` or `_all`.
lenientbooleanIf `true`, format-based query failures (such as providing text to a numeric field) in the query string will be ignored. This parameter can only be used when the `q` query string parameter is specified.
max_concurrent_shard_requestsinteger (int32)Defines the number of concurrent shard requests per node this search executes concurrently. This value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests.
Default 5
phase_tookbooleanIndicates whether to return phase-level `took` time values in the response.
Default false
pre_filter_shard_sizeinteger (int32)Defines a threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method (if date filters are mandatory to match but the shard bounds and the query are disjoint). When unspecified, the pre-filter phase is executed if any of these conditions is met: the request targets more than 128 shards; the request targets one or more read-only index; the primary sort of the query targets an indexed field.
preferencestringNodes and shards used for the search. By default, OpenSearch selects from eligible nodes and shards using adaptive replica selection, accounting for allocation awareness. Valid values are: `_only_local` to run the search only on shards on the local node; `_local` to, if possible, run the search on shards on the local node, or if not, select shards using the default method; `_only_nodes:<node-id>,<node-id>` to run the search on only the specified nodes IDs, where, if suitable shards exist on more than one selected node, use shards on those nodes using the default method, or if none of the specified nodes are available, select shards from any available node using the default method; `_prefer_nodes:<node-id>,<node-id>` to if possible, run the search on the specified nodes IDs, or if not, select shards using the default method; `_shards:<shard>,<shard>` to run the search only on the specified shards; `<custom-string>` (any string that does not start with `_`) to route searches with the same `<custom-string>` to the same shards in the same order.
Default "random"
qstringQuery in the Lucene query string syntax using query parameter search. Query parameter searches do not support the full OpenSearch Query DSL but are handy for testing.
request_cachebooleanIf `true`, the caching of search results is enabled for requests where `size` is `0`. Defaults to index level settings.
rest_total_hits_as_intbooleanIndicates whether `hits.total` should be rendered as an integer or an object in the rest search response.
Default false
routingoneOfA custom value used to route operations to a specific shard.
scrollstringPeriod to retain the search context for scrolling. See Scroll search results. By default, this value cannot exceed `1d` (24 hours). You can change this limit using the `search.max_keep_alive` cluster-level setting.
search_pipelinestringCustomizable sequence of processing stages applied to search queries.
search_typeoneOfHow distributed term frequencies are calculated for relevance scoring.
seq_no_primary_termbooleanIf `true`, returns sequence number and primary term of the last modification of each hit.
sizeinteger (int32)Defines the number of hits to return. By default, you cannot page through more than 10,000 hits using the `from` and `size` parameters. To page through more hits, use the `search_after` parameter.
Default 10
sortoneOfA comma-separated list of <field>:<direction> pairs.
statsarray<string>Specific `tag` of the request for logging and statistical purposes.
stored_fieldsoneOfA 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 `_source` parameter defaults to `false`. You can pass `_source: true` to return both source fields and stored fields in the search response.
suggest_fieldstringSpecifies which field to use for suggestions.
suggest_modestringSpecifies the suggest mode. This parameter can only be used when the `suggest_field` and `suggest_text` query string parameters are specified.
One ofalwaysmissingpopular
suggest_sizeinteger (int32)Number of suggestions to return. This parameter can only be used when the `suggest_field` and `suggest_text` query string parameters are specified.
suggest_textstringThe source text for which the suggestions should be returned. This parameter can only be used when the `suggest_field` and `suggest_text` query string parameters are specified.
terminate_afterinteger (int32)Maximum number of documents to collect for each shard. If a query reaches this limit, OpenSearch terminates the query early. OpenSearch collects documents before sorting. Use with caution. OpenSearch applies this parameter to each shard handling the request. When possible, let OpenSearch perform early termination automatically. Avoid specifying this parameter for requests that target data streams with backing indexes across multiple data tiers. If set to `0` (default), the query does not terminate early.
timeoutstringSpecifies 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.
track_scoresbooleanIf `true`, calculate and return document scores, even if the scores are not used for sorting.
track_total_hitsoneOfNumber of hits matching the query to count accurately. If `true`, the exact number of hits is returned at the cost of some performance. If `false`, the response does not include the total number of hits matching the query.
typed_keysbooleanIf `true`, aggregation and suggester names are be prefixed by their respective types in the response.
verbose_pipelinebooleanEnables or disables verbose mode for the search pipeline. When verbose mode is enabled, detailed information about each processor in the search pipeline is included in the search response. This includes the processor name, execution status, input, output, and time taken for processing. This parameter is primarily intended for debugging purposes, allowing users to track how data flows and transforms through the search pipeline.
versionbooleanIf `true`, returns document version as part of a hit.
prettybooleanWhether to pretty-format the returned JSON response.
Default false
humanbooleanWhether to return human-readable values for statistics.
Default false
error_tracebooleanWhether to include the stack trace of returned errors.
Default false
sourcestringThe URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
filter_pathoneOfA comma-separated list of filters used to filter the response. Use wildcards to match any field or part of a field's name. To exclude fields, use `-`.
Response
Returns 200 with a any. Read it in later steps with {{searchGetSearch.response.data.<field>}}.
Need more? See the OpenSearch guide for connection setup and behaviour shared by every action.