PHPackages                             behappy/elasticsearch-plugin - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. behappy/elasticsearch-plugin

ActiveSylius-plugin[API Development](/categories/api)

behappy/elasticsearch-plugin
============================

BitBag Elasticsearch plugin for Sylius.

1.1.0(8y ago)06MITPHPPHP ^7.1

Since Mar 15Pushed 8y ago4 watchersCompare

[ Source](https://github.com/BeHappyCommunication/SyliusElasticsearchPlugin)[ Packagist](https://packagist.org/packages/behappy/elasticsearch-plugin)[ RSS](/packages/behappy-elasticsearch-plugin/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (1)Dependencies (18)Versions (10)Used By (0)

 [ ![](https://raw.githubusercontent.com/bitbager/BitBagCommerceAssets/master/SyliusElasticsearchPlugin.png) ](http://bitbag.shop)
 [ ![](https://camo.githubusercontent.com/a02c4917e7fb679a8bce3e9b5017731dd49a01efc785b1e9639c40d126d79add/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6269746261672f656c61737469637365617263682d706c7567696e2e737667) ](https://packagist.org/packages/bitbag/elasticsearch-plugin "License") [ ![](https://camo.githubusercontent.com/0b18e6b7c3df950c3bf6eefa4344a94ef2eff525da660657e7e547d9a4014fc1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6269746261672f656c61737469637365617263682d706c7567696e2e737667) ](https://packagist.org/packages/bitbag/elasticsearch-plugin "Version") [ ![](https://camo.githubusercontent.com/29fc2cc228b50d29801167a2cbb0cbf836eeb2ada82aef71cbc67e9d0fdd2fd9/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f426974426167436f6d6d657263652f53796c697573456c6173746963736561726368506c7567696e2f6d61737465722e737667) ](http://travis-ci.org/BitBagCommerce/SyliusElasticsearchPlugin "Build status") [ ![](https://camo.githubusercontent.com/7b2963a57727f4ce4e9b7c8cf74fef3b2012ef4ed9bed2849b5e3f07aa2d7294/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f426974426167436f6d6d657263652f53796c697573456c6173746963736561726368506c7567696e2e737667) ](https://scrutinizer-ci.com/g/BitBagCommerce/SyliusElasticsearchPlugin/ "Scrutinizer") [ ![](https://camo.githubusercontent.com/504460d38fb046ae2f4f6560347d25c3e07f6da6e0bd10cb097fe4a244ade4c5/68747470733a2f2f706f7365722e707567782e6f72672f6269746261672f656c61737469637365617263682d706c7567696e2f646f776e6c6f616473) ](https://packagist.org/packages/bitbag/elasticsearch-plugin "Total Downloads")
============================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================

[](#------------------------------------------------------------------------------------------------------------)

Overview
--------

[](#overview)

Working [Sylius](https://sylius.com/) [Elasticsearch](https://www.elastic.co/products/elasticsearch) integration based on [FOSElasticaBundle](https://github.com/FriendsOfSymfony/FOSElasticaBundle). The main goal of this plugin is to support filtering products by options, attributes, taxons, channels and name in the front product list page. It totally replaces the default Sylius `sylius_shop_product_index`route.

What is more, the plugin has a nice Sylius-oriented architecture that allows mapping resources to the Elastic document easier. It is flexible as well, so that you can customize the existing features for your specific business needs.

Support
-------

[](#support)

You can order our support on [this page](https://bitbag.shop/products/sylius-elasticsearch).

We work on amazing eCommerce projects on top of Sylius and Pimcore. Need some help or additional resources for a project? Write us an email on  or visit [our website](https://bitbag.shop/)! 🚀

Demo
----

[](#demo)

We created a demo app with some useful use-cases of the plugin! Visit [demo.bitbag.shop](https://demo.bitbag.shop/en_US/products-list/t-shirts) to take a look at it. The admin can be accessed under [demo.bitbag.shop/admin](https://demo.bitbag.shop/admin) link and `sylius: sylius` credentials.

Installation
------------

[](#installation)

```
$ composer require bitbag/elasticsearch-plugin
```

Add plugin dependencies to your AppKernel.php file:

```
public function registerBundles()
{
    return array_merge(parent::registerBundles(), [
        ...

        new \FOS\ElasticaBundle\FOSElasticaBundle(),
        new \BitBag\SyliusElasticsearchPlugin\BitBagSyliusElasticsearchPlugin(),
    ]);
}
```

Import required config in your `app/config/config.yml` file:

```
# app/config/config.yml

imports:
    ...

    - { resource: "@BitBagSyliusElasticsearchPlugin/Resources/config/config.yml" }
```

Import routing **on top** of your `app/config/routing.yml` file:

```
# app/config/routing.yml

bitbag_sylius_elasticsearch_plugin:
    resource: "@BitBagSyliusElasticsearchPlugin/Resources/config/routing.yml"

redirect_sylius_shop_product_index:
    path: /{_locale}/taxons/{slug}
    controller: Symfony\Bundle\FrameworkBundle\Controller\RedirectController::redirectAction
    defaults:
        route: bitbag_sylius_elasticsearch_plugin_shop_list_products
        permanent: true
    requirements:
        slug: .+
```

With a elasticsearch server running, execute following command:

```
$ bin/console fos:elastica:populate

```

**Note:** If you are running it on production, add the `-e prod` flag to this command. Elastic are created with environment suffix.

Usage
-----

[](#usage)

### Rendering the shop products list

[](#rendering-the-shop-products-list)

When you go now to the `/{_locale}/products/taxon/{slug}` page, you should see a totally new set of filters. You should see something like this:

 [![](https://raw.githubusercontent.com/bitbager/BitBagCommerceAssets/master/BitBagElasticesearchProductIndex.jpg)](https://raw.githubusercontent.com/bitbager/BitBagCommerceAssets/master/BitBagElasticesearchProductIndex.jpg)

You might also want to refer the horizontal menu to a new product list page. Follow below instructions to do so:

1. If you haven't done it yet, create a `_horizontalMenu.html.twig` file in `app/Resources/SyliusShopBundle/views/Taxon` directory.
2. Replace `sylius_shop_product_index` with `bitbag_sylius_elasticsearch_plugin_shop_list_products`.
3. Clean your cache with `bin/console cache:clear` command.
4. 🎉

### Excluding options and attributes in the filter menu

[](#excluding-options-and-attributes-in-the-filter-menu)

You might not want to show some specific options or attributes in the menu. You can set specific parameters for that:

```
parameters:
    bitbag_es_excluded_filter_options: []
    bitbag_es_excluded_filter_attributes: ['book_isbn', 'book_pages']
```

By default all options and attributes are indexed. After you change these parameters, remember to run `bin/console fo:el:po` command again (a shortcut for `fos:elastica:populate`).

### Reindexing

[](#reindexing)

By default, current indexes listen on all Doctrine events. You can override this setting for each index by overriding index definition in your `config.yml` file:

```
fos_elastica:
    indexes:
        bitbag_attribute_taxons:
            types:
                default:
                    persistence:
                        listener:
                            insert: true
                            update: false
                            delete: true
```

Indexes with `bitbag_shop_product`, `bitbag_attribute_taxons` and `bitbag_option_taxons` keys are available so far.

Customization
-------------

[](#customization)

### Available services you can [decorate](https://symfony.com/doc/current/service_container/service_decoration.html) and forms you can [extend](http://symfony.com/doc/current/form/create_form_type_extension.html)

[](#available-services-you-can-decorate-and-forms-you-can-extend)

```
bitbag.sylius_elasticsearch_plugin.context.product_attributes                                BitBag\SyliusElasticsearchPlugin\Context\ProductAttributesContext
bitbag.sylius_elasticsearch_plugin.context.product_options                                   BitBag\SyliusElasticsearchPlugin\Context\ProductOptionsContext
bitbag.sylius_elasticsearch_plugin.context.taxon                                             BitBag\SyliusElasticsearchPlugin\Context\TaxonContext
bitbag.sylius_elasticsearch_plugin.string_formatter                                          BitBag\SyliusElasticsearchPlugin\Formatter\StringFormatter
bitbag.sylius_elasticsearch_plugin.twig.extension.unset_array_elements                       BitBag\SyliusElasticsearchPlugin\Twig\Extension\UnsetArrayElementsExtension
bitbag_sylius_elasticsearch_plugin.controller.action.shop.list_products                      BitBag\SyliusElasticsearchPlugin\Controller\Action\Shop\ListProductsAction
bitbag_sylius_elasticsearch_plugin.controller.request_data_handler.pagination                BitBag\SyliusElasticsearchPlugin\Controller\RequestDataHandler\PaginationDataHandler
bitbag_sylius_elasticsearch_plugin.controller.request_data_handler.shop_product_list         BitBag\SyliusElasticsearchPlugin\Controller\RequestDataHandler\ShopProductListDataHandler
bitbag_sylius_elasticsearch_plugin.controller.request_data_handler.shop_products_sort        BitBag\SyliusElasticsearchPlugin\Controller\RequestDataHandler\ShopProductsSortDataHandler
bitbag_sylius_elasticsearch_plugin.finder.product_attributes                                 BitBag\SyliusElasticsearchPlugin\Finder\ProductAttributesFinder
bitbag_sylius_elasticsearch_plugin.finder.product_options                                    BitBag\SyliusElasticsearchPlugin\Finder\ProductOptionsFinder
bitbag_sylius_elasticsearch_plugin.finder.shop_products                                      BitBag\SyliusElasticsearchPlugin\Finder\ShopProductsFinder
bitbag_sylius_elasticsearch_plugin.form.type.choice_mapper.product_attributes                BitBag\SyliusElasticsearchPlugin\Form\Type\ChoiceMapper\ProductAttributesMapper
bitbag_sylius_elasticsearch_plugin.form.type.choice_mapper.product_options                   BitBag\SyliusElasticsearchPlugin\Form\Type\ChoiceMapper\ProductOptionsMapper
bitbag_sylius_elasticsearch_plugin.form.type.name_filter                                     BitBag\SyliusElasticsearchPlugin\Form\Type\NameFilterType
bitbag_sylius_elasticsearch_plugin.form.type.price_filter                                    BitBag\SyliusElasticsearchPlugin\Form\Type\PriceFilterType
bitbag_sylius_elasticsearch_plugin.form.type.product_attributes_filter                       BitBag\SyliusElasticsearchPlugin\Form\Type\ProductAttributesFilterType
bitbag_sylius_elasticsearch_plugin.form.type.product_options_filter                          BitBag\SyliusElasticsearchPlugin\Form\Type\ProductOptionsFilterType
bitbag_sylius_elasticsearch_plugin.form.type.shop_products_filter                            BitBag\SyliusElasticsearchPlugin\Form\Type\ShopProductsFilterType
bitbag_sylius_elasticsearch_plugin.property_builder.attribute                                BitBag\SyliusElasticsearchPlugin\PropertyBuilder\AttributeBuilder
bitbag_sylius_elasticsearch_plugin.property_builder.attribute_taxons                         BitBag\SyliusElasticsearchPlugin\PropertyBuilder\AttributeTaxonsBuilder
bitbag_sylius_elasticsearch_plugin.property_builder.channel_pricing                          BitBag\SyliusElasticsearchPlugin\PropertyBuilder\ChannelPricingBuilder
bitbag_sylius_elasticsearch_plugin.property_builder.channels                                 BitBag\SyliusElasticsearchPlugin\PropertyBuilder\ChannelsBuilder
bitbag_sylius_elasticsearch_plugin.property_builder.option                                   BitBag\SyliusElasticsearchPlugin\PropertyBuilder\OptionBuilder
bitbag_sylius_elasticsearch_plugin.property_builder.option_taxons                            BitBag\SyliusElasticsearchPlugin\PropertyBuilder\OptionTaxonsBuilder
bitbag_sylius_elasticsearch_plugin.property_builder.product_created_at                       BitBag\SyliusElasticsearchPlugin\PropertyBuilder\ProductCreatedAtPropertyBuilder
bitbag_sylius_elasticsearch_plugin.property_builder.product_name                             BitBag\SyliusElasticsearchPlugin\PropertyBuilder\ProductNameBuilder
bitbag_sylius_elasticsearch_plugin.property_builder.product_taxons                           BitBag\SyliusElasticsearchPlugin\PropertyBuilder\ProductTaxonsBuilder
bitbag_sylius_elasticsearch_plugin.property_builder.sold_units                               BitBag\SyliusElasticsearchPlugin\PropertyBuilder\SoldUnitsPropertyBuilder
bitbag_sylius_elasticsearch_plugin.property_name_resolver.attribute                          BitBag\SyliusElasticsearchPlugin\PropertyNameResolver\ConcatedNameResolver
bitbag_sylius_elasticsearch_plugin.property_name_resolver.channel_pricing                    BitBag\SyliusElasticsearchPlugin\PropertyNameResolver\ConcatedNameResolver
bitbag_sylius_elasticsearch_plugin.property_name_resolver.name                               BitBag\SyliusElasticsearchPlugin\PropertyNameResolver\ConcatedNameResolver
bitbag_sylius_elasticsearch_plugin.property_name_resolver.option                             BitBag\SyliusElasticsearchPlugin\PropertyNameResolver\ConcatedNameResolver
bitbag_sylius_elasticsearch_plugin.property_name_resolver.price                              BitBag\SyliusElasticsearchPlugin\PropertyNameResolver\PriceNameResolver
bitbag_sylius_elasticsearch_plugin.query_builder.contains_name                               BitBag\SyliusElasticsearchPlugin\QueryBuilder\ContainsNameQueryBuilder
bitbag_sylius_elasticsearch_plugin.query_builder.has_attribute_taxon                         BitBag\SyliusElasticsearchPlugin\QueryBuilder\HasTaxonQueryBuilder
bitbag_sylius_elasticsearch_plugin.query_builder.has_attributes                              BitBag\SyliusElasticsearchPlugin\QueryBuilder\HasAttributesQueryBuilder
bitbag_sylius_elasticsearch_plugin.query_builder.has_channel                                 BitBag\SyliusElasticsearchPlugin\QueryBuilder\HasChannelQueryBuilder
bitbag_sylius_elasticsearch_plugin.query_builder.has_option_taxon                            BitBag\SyliusElasticsearchPlugin\QueryBuilder\HasTaxonQueryBuilder
bitbag_sylius_elasticsearch_plugin.query_builder.has_options                                 BitBag\SyliusElasticsearchPlugin\QueryBuilder\HasOptionsQueryBuilder
bitbag_sylius_elasticsearch_plugin.query_builder.has_price_between                           BitBag\SyliusElasticsearchPlugin\QueryBuilder\HasPriceBetweenQueryBuilder
bitbag_sylius_elasticsearch_plugin.query_builder.has_product_taxon                           BitBag\SyliusElasticsearchPlugin\QueryBuilder\HasTaxonQueryBuilder
bitbag_sylius_elasticsearch_plugin.query_builder.is_enabled                                  BitBag\SyliusElasticsearchPlugin\QueryBuilder\IsEnabledQueryBuilder
bitbag_sylius_elasticsearch_plugin.query_builder.product_attributes_by_taxon                 BitBag\SyliusElasticsearchPlugin\QueryBuilder\ProductAttributesByTaxonQueryBuilder
bitbag_sylius_elasticsearch_plugin.query_builder.product_options_by_taxon                    BitBag\SyliusElasticsearchPlugin\QueryBuilder\ProductOptionsByTaxonQueryBuilder
bitbag_sylius_elasticsearch_plugin.query_builder.shop_products                               BitBag\SyliusElasticsearchPlugin\QueryBuilder\ShopProductsQueryBuilder
```

### Parameters you can override in your parameters.yml(.dist) file

[](#parameters-you-can-override-in-your-parametersymldist-file)

```
bitbag_es_excluded_filter_attributes                                      []
bitbag_es_excluded_filter_options                                         []
bitbag_es_shop_attribute_property_prefix                                  attribute
bitbag_es_shop_attribute_taxons_property                                  attribute_taxons
bitbag_es_shop_channels_property                                          channels
bitbag_es_shop_enabled_property                                           enabled
bitbag_es_shop_name_property_prefix                                       name
bitbag_es_shop_option_property_prefix                                     option
bitbag_es_shop_option_taxons_property                                     option_taxons
bitbag_es_shop_product_created_at                                         product_created_at
bitbag_es_shop_product_price_property_prefix                              price
bitbag_es_shop_product_sold_units                                         sold_units
bitbag_es_shop_product_taxons_property                                    product_taxons
fos_elastica.default_index                                                bitbag_shop_product
```

Testing
-------

[](#testing)

```
$ composer install
$ cd tests/Application
$ yarn install
$ yarn run gulp
$ bin/console assets:install web -e test
$ bin/console doctrine:schema:create -e test
$ elasticsearch
$ bin/console fos:elastica:populate -e test
$ bin/console server:run 127.0.0.1:8080 -d web -e test
$ open http://localhost:8080
$ bin/behat
$ bin/phpspec run
```

Contribution
------------

[](#contribution)

Learn more about our contribution workflow on .

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 85.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~13 days

Recently: every ~25 days

Total

9

Last Release

2920d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b30adb2d219a75752aa612453b95a80b9e0a20f62ad84acb54bf78c08436f8e8?d=identicon)[Roshyo](/maintainers/Roshyo)

---

Top Contributors

[![bitbager](https://avatars.githubusercontent.com/u/28542010?v=4)](https://github.com/bitbager "bitbager (108 commits)")[![patrick477](https://avatars.githubusercontent.com/u/21317699?v=4)](https://github.com/patrick477 "patrick477 (8 commits)")[![pogorivan](https://avatars.githubusercontent.com/u/16318640?v=4)](https://github.com/pogorivan "pogorivan (5 commits)")[![SteadEXE](https://avatars.githubusercontent.com/u/1759156?v=4)](https://github.com/SteadEXE "SteadEXE (5 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/behappy-elasticsearch-plugin/health.svg)

```
[![Health](https://phpackages.com/badges/behappy-elasticsearch-plugin/health.svg)](https://phpackages.com/packages/behappy-elasticsearch-plugin)
```

###  Alternatives

[webgriffe/sylius-akeneo-plugin

Plugin allowing to import products data from Akeneo PIM to your Sylius store.

2480.4k](/packages/webgriffe-sylius-akeneo-plugin)[synolia/sylius-akeneo-plugin

Akeneo connector for Sylius.

2497.6k](/packages/synolia-sylius-akeneo-plugin)[bitbag/graphql-plugin

Sylius backend integration for Vue Storefront 2

254.8k](/packages/bitbag-graphql-plugin)[bitbag/vue-storefront2-plugin

Sylius backend integration for Vue Storefront 2

251.5k](/packages/bitbag-vue-storefront2-plugin)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
