orion-search / psr15
The search: endpoints of Orion as a PSR-15 middleware: the manifest's declared routes served through the scoped searcher, RFC 9457 problems, a request-scoped tenant resolver
Requires
- php: >=8.3
- orion-search/core: ^1.0
- psr/http-factory: ^1.0
- psr/http-message: ^1.1 || ^2.0
- psr/http-server-handler: ^1.0
- psr/http-server-middleware: ^1.0
- psr/log: ^3.0
Requires (Dev)
- guzzlehttp/psr7: ^2.7
- orion-search/elasticsearch: ^1.0
- orion-search/solr: ^1.0
- 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:57 UTC
README
The search: endpoints of Orion as a PSR-15 middleware. Each search block in a manifest declares a route; the
middleware serves it through the scoped searcher and answers failures as RFC 9457 problems.
composer require orion-search/psr15
use Orion\Psr15\SearchMiddleware; $middleware = new SearchMiddleware( $graph->manifest(), $graph->searcher(), $responseFactory, // PSR-17 $streamFactory, // PSR-17 $authorizer, // optional: checks the permission an endpoint declares $logger, // optional prefix: '/api', // where the host mounts the routes );
A GET endpoint reads its query string, a POST endpoint a JSON body, with the same keys: q, filter, sort,
page, size, and vector on a hybrid endpoint. A request may only name what the endpoint declares, and only these
keys: any other parameter (a tracking tag, a cache buster) is a 400, so a typo never silently drops a filter.
| Failure | Status | Problem type |
|---|---|---|
| no tenant in the request | 401 | no-tenant |
| the permission the endpoint declares is missing | 403 | forbidden |
| input that does not fit the endpoint or the schema | 400 | invalid-request |
| a clause the engine cannot run, a page past the window | 400 | unsupported-clause |
| a declared path with another method | 405 | method-not-allowed |
| configuration that does not fit, an engine failure | 500 | search-failed (logged) |
RequestTenant is a request-scoped tenant resolver for hosts without Polaris: a middleware that reads the tenant
from the request (an attribute the host's authentication set) and the TenantResolver Orion is configured with.
Declaring endpoints and calling them: the Frameworks guide.