e1on / omines-datatables-elasticsearch-adapter-bundle
Elasticsearch adapter with search_after feature for DataTable Omines bundle
Installs: 5
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- php: >=8.1
- omines/datatables-bundle: ^0.7.1
- symfony/framework-bundle: ^5.4|^6.3|^7.0
- symfony/property-access: ^5.4|^6.3|^7.0
Requires (Dev)
- ruflin/elastica: ^6.2|^7.3.2
README
This bundle provides integration between Elasticsearch and the DataTable bundle for Symfony, enabling efficient querying of Elasticsearch indices and fetching results using the search_after feature. This allows for pagination and quick processing of large volumes of data presented in the DataTable format, leveraging the powerful search capabilities of Elasticsearch.
Install
composer require e1on/omines-datatables-elasticsearch-adapter-bundle
Rules
- Setting a name for a DataTable is required
- Uniq DataTable name for each table
Using
use E1on\OminesDatatablesElasticsearchAdapterBundle\ElasticaAdapter; $table = $this->createDataTable() ->setName('log') ->add('timestamp', DateTimeColumn::class, ['field' => '@timestamp', 'format' => 'Y-m-d H:i:s', 'orderable' => true]) ->add('level', MapColumn::class, [ 'default' => '<span class="label label-default">Unknown</span>', 'map' => ['Emergency', 'Alert', 'Critical', 'Error', 'Warning', 'Notice', 'Info', 'Debug'], ]) ->add('message', TextColumn::class, ['globalSearchable' => true]) ->createAdapter(ElasticaAdapter::class, [ 'client' => ['host' => 'elasticsearch'], 'index' => 'logstash-*', ]);