Skip to content
Document operationsElasticsearch

POST <index>/_search

Run search queries with filters, aggregations, and pagination.

Command
curl -X POST "http://:9200//_search?pretty" -H 'Content-Type: application/json' -d '{"query":{"match":{"message":""}}}'

Example usage

Execute match queries or run filtered aggregations for analytics.

curl -X POST "http://<host>:9200/<index>/_search?pretty" -H 'Content-Type: application/json' -d '{"query":{"match":{"message":"<keywords>"}}}'
curl -X POST "http://<host>:9200/<index>/_search?pretty" -H 'Content-Type: application/json' -d '{"query":{"bool":{"filter":[{"term":{"status":"active"}}]}},"aggs":{"per_user":{"terms":{"field":"user.keyword"}}}}'

Related tags

Document operationssearchobservabilityrest-api