orion-search / opensearch
Orion engine adapter for OpenSearch 2.19 and 3.x on the official client: strict mappings, externally versioned writes and deletes, the neutral query AST compiled to DSL, k-NN through the bundled plugin
dev-main / 1.0.x-dev
2026-10-27 18:15 UTC
Requires
- php: >=8.3
- guzzlehttp/guzzle: ^7.9
- opensearch-project/opensearch-php: ^2.7
- orion-search/core: ^1.0
Requires (Dev)
- 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:56 UTC
README
Orion's engine adapter for OpenSearch 2.19 and 3.x, on the official opensearch-project/opensearch-php client
(one client major speaks to both server lines).
composer require orion-search/opensearch
use OpenSearch\GuzzleClientFactory; use Orion\OpenSearch\OpenSearchEngine; use Orion\Registry\EngineRegistry; $engines = new EngineRegistry(opensearch: new OpenSearchEngine((new GuzzleClientFactory())->create(['base_uri' => $url]))); // or, from a URL: OpenSearchEngine::connect($url)
- 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.- A vector is a
knn_vectoron the Lucene engine (HNSW, the metric as its space type) and turnsindex.knnon for the index; the neutral vector query is the k-NN plugin'sknnquery, filters applied while the neighbours are gathered. Adding a vector field to an index created without one needs a reindex. IndexSchema::native('opensearch', ['settings' => [...], 'mappings' => [...]])merges over the generated body.raw()takescallable(): arrayreturning a search body; scope filters are ANDed into it and into everyknnquery; search pipelines, aggregations, suggesters and derived fields are refused under a scope.- Native hybrid search needs a search pipeline whose normalisation is not Orion's deterministic fusion, so
HybridFusionis reported false and core fuses.
Proven by Orion\Testing\EngineConformanceTestCase against OpenSearch 3.9 and 2.19.
Connecting it and how it compares with the other engines: the Engines guide.