chameleon-system/elasticsearch-bundle
Connects Chameleon to ElasticSearch
Requires
- ongr/elasticsearch-bundle: 0.7.0
- dev-master
- 7.1.x-dev
- 7.0.x-dev
- 7.0.0
- 6.3.x-dev
- 6.3.1
- 6.3.0
- 6.2.x-dev
- 6.2.0
- 6.1.x-dev
- 6.1.5
- 6.1.4
- 6.1.3
- 6.1.2
- 6.1.1
- 6.1.0.1
- 6.1.0
- 6.0.x-dev
- 6.0.11
- 6.0.10
- 6.0.9
- 6.0.8
- 6.0.5
- 6.0.4
- 6.0.3
- 6.0.2
- 6.0.1
- 6.0.0
- 5.8.x-dev
- 5.8.1
- 5.8.0
- dev-tmp_fix_branch_schafferer
- dev-fix/37488-fix-warnings-using-executeQuery-method-to-support-array-binding
- dev-update/elastic-search
- dev-fix/35159-fix-signature-6.1
- dev-fix/33922-escape-search-query-string
- dev-add-update-hooks-for-statistics-and-stock
- dev-feature/29192-add-last-seen-sort
- dev-fix/29192-update_aggregation_names_to_avoid_duplicate_naming
- dev-fix/29192-fix-limit-in-aggregations
- dev-multi-language-handling
README
Step 1: Download the Bundle
Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:
$ composer require chameleon-system/elasticsearch-bundle "dev-master"
This command requires you to have Composer installed globally, as explained in the installation chapter of the Composer documentation.
Step 2: Enable the Bundle
Then, enable the bundle by adding the following line in the app/AppKernel.php
file of your project:
<?php
// app/AppKernel.php
// ...
public function registerBundles()
{
$bundles = array(
// ...
new \ONGR\ElasticsearchBundle\ONGRElasticsearchBundle(),
new \ChameleonSystem\ElasticSearchBundle\ChameleonSystemElasticsearchBundle()
);
}
Step 3: Create and fill index
Create an index (that's like a database in MySQL) using the ongr bundle (see command.md in ongr-io/ElasticsearchBundle docs linked below)
app/console es:index:create
Fill an index using the proof of concept command
app/console ch:esindex:fill
Step 4: RTFM
Bird's eye view: Create Index, Add Documents, Retrieve Documents, Search easily from within your Symfony2 environment:
https://github.com/ongr-io/ElasticsearchBundle/tree/master/Resources/doc
In depth knowledge in the elasticsearch book:
http://www.elasticsearch.org/guide/en/elasticsearch/guide/current/
Add Custom Fields to Index
To add custom fields, you need to modify the mapping and you need to extract the data from the shop article.
The first can be done by implementing \ChameleonSystem\ElasticsearchBundle\Interfaces\IndexMappingModifierInterface, creating a service for the implementation and tagging it with chameleon_system.elasticsearch_mapping_modifier.
To add data from the shop article to your index, you then need to implement \ChameleonSystem\ElasticsearchBundle\Interfaces\ShopArticleToElasticSearchIndexDataMapperInterface. Create a service for the implementation and tag it with chameleon_system.elasticsearch_data_mapper.