05 · REFERENCE

ES-compatible API

Port 9200. The compat layer exists so you can point an existing Elasticsearch client at XERJ and keep shipping. It handles the most-used operations. Unsupported calls return a structured not_supported_yet error rather than a 500.

METHOD
PATH
DESCRIPTION
PUT
/:index
Create index (ES-shape body).
DELETE
/:index
Drop index.
PUT
/:index/_mapping
Update mapping. Additive only.
POST
/:index/_doc
Index a document (auto-id).
PUT
/:index/_doc/:id
Index a document with an explicit id.
GET
/:index/_doc/:id
Fetch a document.
DELETE
/:index/_doc/:id
Delete a document.
POST
ES query DSL. See the query types reference.
POST
/:index/_bulk
NDJSON bulk. Actions: index, create, update, delete.
POST
/:index/_delete_by_query
Streaming delete. Respects the query's filter context.
GET
/_cluster/health
ES-shaped cluster health JSON.
GET
/_cat/indices
Human-readable index listing.

Bulk indexing example

$ curl -sX POST http://localhost:9200/logs/_bulk \
    -H 'Content-Type: application/x-ndjson' \
    --data-binary '@-' <<'JSON'
{"index":{"_id":"1"}}
{"@timestamp":"2026-04-14T12:00:00Z","service":"auth","level":"error","message":"login failed"}
{"index":{"_id":"2"}}
{"@timestamp":"2026-04-14T12:00:01Z","service":"auth","level":"warn","message":"rate limited"}
JSON

Source · engine/crates/api/src/es_compat.rs