Download the PHP package xola/elasticsearch-proxy-bundle without Composer
On this page you can find all versions of the php package xola/elasticsearch-proxy-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download xola/elasticsearch-proxy-bundle
More information about xola/elasticsearch-proxy-bundle
Files in xola/elasticsearch-proxy-bundle
Package elasticsearch-proxy-bundle
Short Description A Symfony2 plugin that acts as an authorization proxy for elasticsearch
License MIT
Homepage https://github.com/xola/XolaElasticsearchProxyBundle
Informations about the package elasticsearch-proxy-bundle
XolaElasticsearchProxyBundle
A Symfony2 plugin that acts as a proxy for Elasticsearch.
Installation
With composer, add:
Then enable it in your kernel:
Configuration
The indexes
parameter lets you grant access to only the specified elasticsearch indexes.
Routing
Update your routing
The default path is /elasticsearch
and permits all HTTP methods (GET, PUT, POST, etc.).
Override it. Ensure index
(to capture elastic search index) and slug
(to capture rest of the url) remain in the
route pattern.
Events
There are a couple of events fired by the bundle controller that can help you. By listening to these events you can add any custom authentication or filtering logic you require.
-
elasticsearch_proxy.before_elasticsearch_request
- This event is fired before the request is sent to Elasticsearch. The listener will receiveElasticsearchProxyEvent
as an argument containing the request, index, slug, and the query object. You may modify this query object and set it back on the event withsetQuery
. The updated request will then be sent on to Elasticsearch. elasticsearch_proxy.after_elasticsearch_response
- This event is fired after a response has been received from Elasticsearch. The listener will receiveElasticsearchProxyEvent
as argument containing the request, index, slug, query, and response objects. You may modify the response and set it back into the event. The updated response is then sent back to the client.
All versions of elasticsearch-proxy-bundle with dependencies
symfony/framework-bundle Version >=2.1 <4.0
ext-curl Version *
ext-json Version *