es_search
Search Elasticsearch indices with query DSL, pagination, sorting, aggregations, and source projection; returns status and body or root-cause errors.
Instructions
Search an index. Wraps POST /{index}/_search. query is the query DSL only; sort, from, search_after, track_total_hits, highlight, script_fields and source (_source) map to the same-named body keys. size defaults to 10; with aggs and no query it is forced to 0. Page with from+size or sort+search_after. Use source to project fields and keep responses small. Returns {status, body}; a 4xx/5xx is an error with the ES root cause.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| aggs | No | ||
| from | No | ||
| size | No | ||
| sort | No | e.g. [{"@timestamp": "desc"}] | |
| index | Yes | index, alias, comma list or wildcard, e.g. logs-*,metrics | |
| query | No | query DSL only, e.g. {"bool": {...}} | |
| source | No | _source projection: list of fields or false | |
| highlight | No | ||
| connection | Yes | ||
| search_after | No | sort values of the last hit | |
| script_fields | No | ||
| track_total_hits | No |