• Getting Started with Sylius
    • Installation
    • Basic configuration
    • Shipping & Payment
    • First product
    • Shop Customizations
    • Custom business logic
    • Using API
    • Plugin installation
    • Deployment
    • Summary
  • The Book
    • Introduction
    • Installation
    • Architecture
    • Configuration
    • Customers
    • Products
    • Carts & Orders
    • API
    • Frontend
    • Themes
    • Sylius Plus
    • Sylius Plugins
    • Organization
    • Support
    • Contributing
  • The Customization Guide
    • Customizing Models
    • Customizing Forms
    • Customizing Repositories
    • Customizing Factories
    • Customizing Controllers
    • Customizing Validation
    • Customizing Menus
    • Customizing Templates
    • Customizing Translations
    • Customizing Flashes
    • Customizing State Machines
    • Customizing Grids
    • Customizing Fixtures
    • Customizing Fixture Suites
    • Customizing API
    • Tips & Tricks
    • Good to know
  • The Cookbook
    • Entities
    • Administration
    • Shop
    • Payments
    • Emails
    • Promotions
    • Inventory
    • Shipping methods
    • Images
    • Deployment
    • Configuration
    • Frontend
    • Taxation
    • API
  • The BDD Guide
    • Basic Usage
    • How to add a new context?
    • How to add a new page object?
    • How to define a new suite?
    • How to use transformers?
  • Components & Bundles
    • Sylius Bundles Documentation
    • Sylius Components Documentation
  • The Performance Guide
    • Database indexes
    • Query optimization
đź”” Roadmap
Blackfire
 
Sylius
  • Docs »
  • The Book »
  • Products »
  • Search
  • Sylius demo
  • |
  • Edit on GitHub
Sylius

Search¶

Having a products search functionality in an eCommerce system is a very popular use case. Sylius provides a products search functionality that is a grid filter.

Grid filters¶

For simple use cases of products search use the filters of grids. For example, the shop’s categories each have a search filter in the products grid:

# Sylius/Bundle/ShopBundle/Resources/config/grids/product.yml
filters:
    search:
        type: string
        label: false
        options:
            fields: [translation.name]
        form_options:
            type: contains

It searches by product names that contains a string that the user typed in the search bar.

The search bar looks like below:

../../_images/search.png

Customizing search filter¶

The search bar in many shops should be more sophisticated, than just a simple text search. You may need to add searching by price, reviews, sizes or colors.

If you would like to extend this built-in functionality read this article about grids customizations, and the GridBundle docs.

ElasticSearch¶

When the grids filtering is not enough for you, and your needs are more complex you should go for the ElasticSearch integration.

There is the BitBagCommerce/SyliusElasticsearchPlugin integration extension, which you can use to extend Sylius functionalities with ElasticSearch.

All you have to do is require the plugin in your project via composer, install the ElasticSearch server, and configure ElasticSearch in your application. Everything is well described in the BitBagCommerce/SyliusElasticsearchPlugin’s readme.

Learn more¶

  • SyliusElasticSearchPlugin
  • GridBundle documentation
Next Previous

© Copyright 2011-2023, PaweĹ‚ JÄ™drzejewski.

Sphinx theme provided by Read the Docs.
Read the Docs v: 1.12
Versions
latest
1.13
1.12
1.11
1.10
1.9
1.8
1.7
1.6
1.5
1.4
1.3
1.2
1.1
1.0
Downloads
html
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.