03 · START

Migrate from Elasticsearch

XERJ runs a second API listener on 9200 that speaks the Elasticsearch wire format. The fast path to trying XERJ is to point your existing ES client at it and let the compat layer take the calls. It isn't 100% coverage; this page says exactly what is and isn't there.

What we test against

What works day one

What needs rewriting

Known semantic differences

What follows are differences on APIs that are implemented: the call succeeds and returns the ES response shape, but the bytes are XERJ's own. They bite when a client asserts on details rather than shapes.

What's different (for the better)

A 10-minute migration

# 1. run XERJ alongside ES
$ xerj --config xerj.toml &

# 2. reindex one index, one-shot
$ curl -sX POST http://es:9200/logs-2026-04/_search?scroll=1m \
    -d '{"size":1000,"query":{"match_all":{}}}' \
    | jq -c '.hits.hits[]._source' \
    | xerj-ingest http://localhost:9200 logs-2026-04

# 3. compare one query
$ diff <(curl -s http://es:9200/logs-2026-04/_search -d @q.json) \
       <(curl -s http://localhost:9200/logs-2026-04/_search -d @q.json)

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