gbprod / elasticsearch-extra-bundle
Extra tools for m6web/elasticsearch-bundle
Installs: 229
Dependents: 0
Suggesters: 1
Security: 0
Stars: 2
Watchers: 2
Forks: 0
Open Issues: 6
Type:bundle
Requires
- php: >=5.5
- m6web/elasticsearch-bundle: ^1.0
- symfony/console: ^2.3|^3.0
- symfony/framework-bundle: ^2.3|^3.0
- symfony/yaml: ^2.3|^3.0
Requires (Dev)
- atoum/atoum: ^2.6
This package is auto-updated.
Last update: 2020-06-07 07:56:57 UTC
README
I will not maintain this bundle anymore, prefer elastica-extra-bundle.
Extra tools for managing indices and types. Built on top of m6web/elasticsearch-bundle.
Installation
With composer :
composer require gbprod/elasticsearch-extra-bundle
Update your app/AppKernel.php
file:
public function registerBundles() { $bundles = array( new M6Web\Bundle\ElasticsearchBundle\M6WebElasticsearchBundle(), new GBProd\ElasticsearchExtraBundle\ElasticsearchExtraBundle(), ); }
See M6WebElasticsearchBundle for configuring clients.
Index Management Operations
Configuration
Set indices setup
elasticsearch_extra: indices: my_index: settings: number_of_shards: 3 number_of_replicas: 2 mappings: my_type: _source: enabled: true properties: first_name: type: string analyzer: standard age: type: integer my_index_2: ~
See Official documentation for options.
Create index
With default client:
php app/console elasticsearch:index:create my_index
Or with specified client:
php app/console elasticsearch:index:create my_index --client=my_client
Delete index
With default client:
php app/console elasticsearch:index:delete my_index --force
Or with specified client:
php app/console elasticsearch:index:delete my_index --force --client=my_client
Put index settings
With default client:
php app/console elasticsearch:index:put_settings my_index
Or with specified client:
php app/console elasticsearch:index:put_settings my_index --client=my_client
Put index mappings
With default client:
php app/console elasticsearch:index:put_mappings my_index my_type
Or with specified client:
php app/console elasticsearch:index:put_mappings my_index my_type --client=my_client