GET /_cluster/health | Cluster health status |
GET /_cluster/state | Cluster state info |
GET /_cluster/stats | Cluster statistics |
GET /_nodes | Node information |
GET /_nodes/stats | Node statistics |
GET /_cat/nodes?v | Nodes overview (tabular) |
GET /_cat/indices?v | List all indices |
PUT /index_name | Create index |
DELETE /index_name | Delete index |
POST /index_name/_close | Close index |
POST /index_name/_open | Open index |
GET /index_name/_settings | Get index settings |
GET /index_name/_mapping | Get mapping |
PUT /index_name { "settings": { "number_of_shards": 3, "number_of_replicas": 1 } } | Create with settings |
PUT /index_name/_settings { "number_of_replicas": 2 } | Update settings |
POST /index_name/_refresh | Refresh index |
POST /index_name/_flush | Flush index |
POST /index_name/_forcemerge | Force merge segments |
PUT /index_name { "mappings": { "properties": { "field": { "type": "text" } } } } | Create index with mapping |
PUT /index_name/_mapping { "properties": { "new_field": { "type": "keyword" } } } | Add field to mapping |
"type": "text" | Full-text searchable |
"type": "keyword" | Exact value, aggregations |
"type": "long", "integer", "short", "byte" | Integer types |
"type": "double", "float" | Floating point |
"type": "boolean" | Boolean |
"type": "date" | Date/datetime |
"type": "object" | JSON object |
"type": "nested" | Nested object (array) |
"type": "geo_point" | Lat/lon point |
POST /index/_doc { "field": "value" } | Create document (auto ID) |
PUT /index/_doc/1 { "field": "value" } | Create/update with ID |
POST /index/_create/1 { "field": "value" } | Create only (fail if exists) |
POST /index/_bulk | Bulk index documents |
GET /index/_doc/1 | Get document by ID |
GET /index/_source/1 | Get source only |
HEAD /index/_doc/1 | Check if exists |
GET /index/_mget { "ids": ["1", "2"] } | Get multiple documents |
POST /index/_update/1 { "doc": { "field": "new_value" } } | Partial update |
POST /index/_update/1 { "script": { "source": "ctx._source.count += 1" } } | Update with script |
DELETE /index/_doc/1 | Delete document |
POST /index/_delete_by_query { "query": { "match": { "field": "value" } } } | Delete by query |
POST /index/_update_by_query { "query": {...}, "script": {...} } | Update by query |
GET /index/_search | Search all documents |
GET /index/_search?q=field:value | URI search |
GET /index/_search { "query": { "match_all": {} } } | Match all |
GET /index/_search { "query": { "match": { "field": "text" } } } | Full-text match |
GET /index/_search { "query": { "term": { "status": "active" } } } | Exact term match |
{ "match": { "field": "search text" } } | Full-text search |
{ "match_phrase": { "field": "exact phrase" } } | Phrase match |
{ "multi_match": { "query": "text", "fields": ["f1", "f2"] } } | Search multiple fields |
{ "term": { "status": "active" } } | Exact term |
{ "terms": { "status": ["active", "pending"] } } | Multiple terms |
{ "range": { "age": { "gte": 18, "lte": 65 } } } | Range query |
{ "exists": { "field": "email" } } | Field exists |
{ "prefix": { "name": "Jo" } } | Prefix match |
{ "wildcard": { "name": "Jo*n" } } | Wildcard match |
{ "fuzzy": { "name": { "value": "john", "fuzziness": "AUTO" } } } | Fuzzy match |
{ "bool": { "must": [...], "should": [...], "must_not": [...], "filter": [...] } } | Boolean query |
"must": [query1, query2] | AND - all must match |
"should": [query1, query2] | OR - at least one |
"must_not": [query] | NOT - must not match |
"filter": [query] | Filter (no scoring) |
{ "from": 0, "size": 10 } | Pagination |
{ "sort": [{ "date": "desc" }] } | Sort results |
{ "sort": [{ "date": "desc" }, "_score"] } | Multi-field sort |
{ "_source": ["field1", "field2"] } | Select fields |
{ "_source": false } | Exclude source |
{ "highlight": { "fields": { "content": {} } } } | Highlight matches |
{ "highlight": { "pre_tags": ["<em>"], "post_tags": ["</em>"], "fields": {...} } } | Custom highlight tags |
{ "aggs": { "avg_price": { "avg": { "field": "price" } } } } | Average |
{ "aggs": { "total": { "sum": { "field": "amount" } } } } | Sum |
{ "aggs": { "stats": { "stats": { "field": "price" } } } } | Stats (min, max, avg, sum, count) |
{ "aggs": { "unique_users": { "cardinality": { "field": "user_id" } } } } | Unique count |
{ "aggs": { "by_status": { "terms": { "field": "status" } } } } | Group by terms |
{ "aggs": { "by_range": { "range": { "field": "price", "ranges": [...] } } } } | Range buckets |
{ "aggs": { "by_date": { "date_histogram": { "field": "date", "calendar_interval": "month" } } } } | Date histogram |
{ "aggs": { "by_price": { "histogram": { "field": "price", "interval": 100 } } } } | Histogram |
{ "aggs": { "by_category": { "terms": {...}, "aggs": { "avg_price": { "avg": {...} } } } } } | Sub-aggregation |