gbprod/elasticsearch-extra-bundle

This package is abandoned and no longer maintained. No replacement package was suggested.

Extra tools for m6web/elasticsearch-bundle

v0.1.0 2016-03-25 21:02 UTC

This package is auto-updated.

Last update: 2020-06-07 07:56:57 UTC


README

stability-deprecated

I will not maintain this bundle anymore, prefer elastica-extra-bundle.

Build Status Scrutinizer Code Quality Code Coverage

Latest Stable Version Total Downloads Latest Unstable Version License

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