PHPackages                             sylius/search-bundle - 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. [Search &amp; Filtering](/categories/search)
4. /
5. sylius/search-bundle

AbandonedArchivedSymfony-bundle[Search &amp; Filtering](/categories/search)

sylius/search-bundle
====================

Product catalog for your Symfony2 applications.

v0.19.0(9y ago)57.1k9[1 PRs](https://github.com/Sylius/SyliusSearchBundle/pulls)MITPHPPHP ^5.6|^7.0

Since Dec 4Pushed 9y ago3 watchersCompare

[ Source](https://github.com/Sylius/SyliusSearchBundle)[ Packagist](https://packagist.org/packages/sylius/search-bundle)[ Docs](http://sylius.org)[ RSS](/packages/sylius-search-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (10)Versions (9)Used By (0)

SyliusSearchBundle [![Build status...](https://camo.githubusercontent.com/35201a88973ef477d201d1fb38b762f5559ed8d0255e51e80663af124b61f47b/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f53796c6975732f53796c69757353656172636842756e646c652e706e673f6272616e63683d6d6173746572)](http://travis-ci.org/Sylius/SyliusSearchBundle)
=============================================================================================================================================================================================================================================================================================================================================

[](#syliussearchbundle-)

Search system for [**Symfony2**](http://symfony.com) applications.

It supports search functionality for mysql and elastic search.

Usage:

Place the following snippets on a twig view and you are ready to go.

```
{% render controller('SyliusSearchBundle:Search:form', {'request':app.request}) %}

{% include 'SyliusSearchBundle::filter_form.html.twig' %}
```

If you want to use the search pragmatically there are currently 2 query types, string query and taxon query.

```
$finder = $this->get('sylius_search.finder')
            ->setTargetIndex('product') // target index searches in a specific type, if it's not set it searches in all types
            ->setFacetGroup('search_set') // configuration based, uses the relevant facet set, if not set it does not show facets
            ->find(new SearchStringQuery(...));
```

Taxon

```
$finder = $this->get('sylius_search.finder')
            ->setFacetGroup('categories_set')
            ->find(new TaxonQuery(...));
```

Basic configuration guidelines:

### Form

[](#form)

```
form: 'SyliusSearchBundle::form.html.twig'
```

The actual form you want to use for performing a search. As long as the naming of the elements is the same you can define a new twig file with your own design.

### Request method

[](#request-method)

The default value for both search and filter forms is GET but you can use post by adding the following snippet on the configuration

```
request_method: POST
```

### Engine

[](#engine)

```
engine: orm
```

Possible values: orm, elasticsearch

If orm is selected the search uses mysql as engine, if elasticsearch is selected if uses the elasticsearch search engine, which must be configured through the fos\_elastica bundle. For documentation on fos\_elastica please check the [fos\_elastica github page](https://github.com/FriendsOfSymfony/FOSElasticaBundle).

### Query logger

[](#query-logger)

By default query logger is disabled.

If you wish to using you need to add the following configuration parameters. Query logger currently supports orm for smaller websites and elasticsearch for one with higher transactions. In the future we need to introduce queue support.

```
query_logger:
    enabled: true
    engine: orm
```

### Indexes

[](#indexes)

```
orm_indexes: # it is being used only when orm is selected as a driver
        product: # indentifier of an index
            class: Sylius\Component\Core\Model\Product # the corresponding model
            mappings: # appart from the id, the rest of the fields will be used to compile the searchable content
                id: ~
                name: ~
                description: ~
```

if elasticsearch is selected here is a sample configuration

```
fos_elastica:
     clients:
         elasticsearch:
            servers:
                - { host: 10.0.0.100, port: 9200, logger: true }
                - { host: 10.0.0.101, port: 9200, logger: true }
           #for clustering you need to define the logger because of the https://github.com/FriendsOfSymfony/FOSElasticaBundle/issues/543
     indexes:
         sylius:
             client: elasticsearch
             finder: ~
             settings:
                 analysis:
                     filter:
                         synonym:
                             type: synonym
                             synonyms: synonym.txt
                     analyzer:
                         my_analyzer:
                             filter: synonym
                             type: standard
                             tokenizer: standard
             types:
                 product:
                     mappings:
                         id: { type: integer, index: not_analyzed }
                         name: { type: string, analyzer: my_analyzer }
                         description: { type: string }
                         price: { type: integer }
                         shortDescription: { type: string }
                         slug: { type: string, index: not_analyzed }
                         translations:
                             type: nested
                             properties:
                                 locale: { type: string, index: not_analyzed }
                                 name: { type: string }
                                 metaKeywords: { type: string }
                                 metaDescription: { type: string }
                         variants:
                             type: nested
                             properties:
                                 code: { type: string }
                                 availableOn: { type: date, index: not_analyzed }
                                 availableUntil: { type: date }
                                 name: { type: string }
                                 onHand: { type: integer, index: not_analyzed }
                                 onHold: { type: integer, index: not_analyzed }
                         attributes:
                             type: nested
                             properties:
                                 value: { type: string }
                         channels: { type: string, index: not_analyzed }
                         taxons: { type: string, index: not_analyzed }
                         enabled: { type: boolean }

                     persistence:
                         driver: orm
                         model: Sylius\Component\Core\Model\Product
                         model_to_elastica_transformer:
                            service: sylius.search.transformers.model.product
                         provider: ~
                         listener: ~
                         finder: ~

                 search_log:
                    mappings:
                        search_term: ~
                        ip_address: ~
```

### Filters

[](#filters)

```
filters:
        search_filter: # the small drop down menu on the side of the search field
            enabled: true
            taxon: category # possible values are taxons codes (category, brand for sylius)
        facet_groups: # possible facet groups, you assign them in a finder object
            search_set:
                values: [taxons, price, made_of, color]
            categories_set:
                values: [price, made_of, color]
            all_set:
                values: [taxons, price, made_of]
        facets: # possible facets, as long as a model exposes attributes, options or getters with the given name, it will be used as a facet
            taxons:
                display_name: 'Basic categories'
                type: terms
                value: ~
            price:
                display_name: 'Available prices'
                type: range
                values:
                    - { from: 0, to: 2000}
                    - { from: 2001, to: 5000}
                    - { from: 5001, to: 10000}
            made_of:
                display_name: 'Material'
                type: terms
                value: ~
            color:
                display_name: 'Available colors'
                type: terms
                value: ~
```

### Indexing data

[](#indexing-data)

After configuring the indexer properly you execute the following command to populate the appropriate engine:

```
app/console sylius:search:index
```

Sylius
------

[](#sylius)

**Sylius** - Modern ecommerce for Symfony2. Visit [Sylius.org](http://sylius.org).

[phpspec](http://phpspec.net) examples
--------------------------------------

[](#phpspec-examples)

```
$ composer install
$ bin/phpspec run -fpretty
```

[behat](http://behat.org) examples for search bundle
----------------------------------------------------

[](#behat-examples-for-search-bundle)

```
$ composer install
$ /bin/behat --suite=search
```

Documentation
-------------

[](#documentation)

Documentation is available on [**docs.sylius.org**](http://docs.sylius.org/en/latest/bundles/SyliusSearchBundle/index.html).

Contributing
------------

[](#contributing)

All informations about contributing to Sylius can be found on [this page](http://docs.sylius.org/en/latest/contributing/index.html).

Mailing lists
-------------

[](#mailing-lists)

### Users

[](#users)

Questions? Feel free to ask on [users mailing list](http://groups.google.com/group/sylius).

### Developers

[](#developers)

To contribute and develop this bundle, use the [developers mailing list](http://groups.google.com/group/sylius-dev).

Sylius twitter account
----------------------

[](#sylius-twitter-account)

If you want to keep up with updates, [follow the official Sylius account on twitter](http://twitter.com/Sylius).

Bug tracking
------------

[](#bug-tracking)

This bundle uses [GitHub issues](https://github.com/Sylius/Sylius/issues). If you have found bug, please create an issue.

Versioning
----------

[](#versioning)

Releases will be numbered with the format `major.minor.patch`.

And constructed with the following guidelines.

- Breaking backwards compatibility bumps the major.
- New additions without breaking backwards compatibility bumps the minor.
- Bug fixes and misc changes bump the patch.

For more information on SemVer, please visit [semver.org website](http://semver.org/). This versioning method is same for all **Sylius** bundles and applications.

MIT License
-----------

[](#mit-license)

License can be found [here](https://github.com/Sylius/SyliusSearchBundle/blob/master/Resources/meta/LICENSE).

Authors
-------

[](#authors)

The bundle was originally created by [Argyrios Gounaris](http://agounaris.github.io). See the list of [contributors](https://github.com/Sylius/SyliusProductBundle/contributors).

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community25

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor3

3 contributors hold 50%+ of commits

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 ~80 days

Recently: every ~73 days

Total

8

Last Release

3618d ago

PHP version history (3 changes)v0.12.0PHP &gt;=5.3.3

v0.16.0PHP ^5.5.9|^7.0

v0.19.0PHP ^5.6|^7.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/719423?v=4)[Sylius eCommerce](/maintainers/sylius)[@Sylius](https://github.com/Sylius)

---

Top Contributors

[![agounaris](https://avatars.githubusercontent.com/u/1845809?v=4)](https://github.com/agounaris "agounaris (26 commits)")[![pamil](https://avatars.githubusercontent.com/u/1897953?v=4)](https://github.com/pamil "pamil (24 commits)")[![pjedrzejewski](https://avatars.githubusercontent.com/u/614970?v=4)](https://github.com/pjedrzejewski "pjedrzejewski (17 commits)")[![stloyd](https://avatars.githubusercontent.com/u/67402?v=4)](https://github.com/stloyd "stloyd (6 commits)")[![loevstroem](https://avatars.githubusercontent.com/u/1077111?v=4)](https://github.com/loevstroem "loevstroem (6 commits)")[![bendavies](https://avatars.githubusercontent.com/u/625392?v=4)](https://github.com/bendavies "bendavies (5 commits)")[![arnolanglade](https://avatars.githubusercontent.com/u/3585922?v=4)](https://github.com/arnolanglade "arnolanglade (4 commits)")[![okwinza](https://avatars.githubusercontent.com/u/108925?v=4)](https://github.com/okwinza "okwinza (3 commits)")[![NoResponseMate](https://avatars.githubusercontent.com/u/9448101?v=4)](https://github.com/NoResponseMate "NoResponseMate (3 commits)")[![Zales0123](https://avatars.githubusercontent.com/u/6212718?v=4)](https://github.com/Zales0123 "Zales0123 (3 commits)")[![koemeet](https://avatars.githubusercontent.com/u/1569156?v=4)](https://github.com/koemeet "koemeet (2 commits)")[![mhujer](https://avatars.githubusercontent.com/u/353372?v=4)](https://github.com/mhujer "mhujer (2 commits)")[![aramalipoor](https://avatars.githubusercontent.com/u/1164589?v=4)](https://github.com/aramalipoor "aramalipoor (2 commits)")[![hason](https://avatars.githubusercontent.com/u/288535?v=4)](https://github.com/hason "hason (2 commits)")[![kkarski82](https://avatars.githubusercontent.com/u/7520890?v=4)](https://github.com/kkarski82 "kkarski82 (1 commits)")[![aitboudad](https://avatars.githubusercontent.com/u/1753742?v=4)](https://github.com/aitboudad "aitboudad (1 commits)")[![cdaguerre](https://avatars.githubusercontent.com/u/4642448?v=4)](https://github.com/cdaguerre "cdaguerre (1 commits)")[![Dukecz](https://avatars.githubusercontent.com/u/361060?v=4)](https://github.com/Dukecz "Dukecz (1 commits)")[![fulopattila122](https://avatars.githubusercontent.com/u/1162360?v=4)](https://github.com/fulopattila122 "fulopattila122 (1 commits)")[![GeLoLabs](https://avatars.githubusercontent.com/u/149005863?v=4)](https://github.com/GeLoLabs "GeLoLabs (1 commits)")

---

Tags

searchshopecommerceproductproducts

### Embed Badge

![Health badge](/badges/sylius-search-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/sylius-search-bundle/health.svg)](https://phpackages.com/packages/sylius-search-bundle)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[sylius/product-bundle

Product catalog for your Symfony applications.

16324.5k12](/packages/sylius-product-bundle)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

595.2M386](/packages/shopware-core)[sylius/core-bundle

Sylius core bundle. It integrates all other bundles into full stack Symfony ecommerce solution.

22100.0k46](/packages/sylius-core-bundle)[sylius/taxonomy-bundle

Flexible categorization system for Symfony.

26388.2k7](/packages/sylius-taxonomy-bundle)[sylius/addressing-bundle

Addressing and zone management for Symfony applications.

33221.4k3](/packages/sylius-addressing-bundle)

PHPackages © 2026

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