orion-search / elasticsearch
Orion engine adapter for Elasticsearch 8.19 and 9.x on the official client: strict mappings, externally versioned writes and deletes, the neutral query AST compiled to DSL
dev-main / 1.0.x-dev
2026-10-27 18:15 UTC
Requires
- php: >=8.3
- elasticsearch/elasticsearch: ^8.19 || ^9.0
- orion-search/core: ^1.0
Requires (Dev)
- guzzlehttp/guzzle: ^7.9
- orion-search/testing: ^1.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-10-27 19:15:58 UTC
README
Orion's engine adapter for Elasticsearch 8.19 and 9.x, on the official elasticsearch/elasticsearch client
(install the client major that matches your server: client 9 cannot talk to an 8.x cluster).
composer require orion-search/elasticsearch
use Elastic\Elasticsearch\ClientBuilder; use Orion\Elasticsearch\ElasticsearchEngine; use Orion\Registry\EngineRegistry; $engines = new EngineRegistry(elasticsearch: new ElasticsearchEngine(ClientBuilder::create()->setHosts([$url])->build()));
- Mappings are
dynamic: strict: a document carrying an undeclared field fails alone instead of growing the mapping. - Writes and deletes are externally versioned with the outbox offset; a version conflict is a stale write, never a failure, so replayed and live writes converge.
integermaps tolong,floattodouble; any other native type inspects as unknown and fails a plan closed.IndexSchema::native('elasticsearch', ['settings' => [...], 'mappings' => [...]])merges over the generated body.raw()takescallable(): arrayreturning a search body; scope filters are ANDed into it.- Native hybrid fusion (the RRF retriever) needs a paid license, so
HybridFusionis reported false and core fuses.
Proven by Orion\Testing\EngineConformanceTestCase against Elasticsearch 9.5 and 8.19.
Connecting it and how it compares with the other engines: the Engines guide.