Download the PHP package marcelsud/elastic-search-plugin without Composer
On this page you can find all versions of the php package marcelsud/elastic-search-plugin. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download marcelsud/elastic-search-plugin
More information about marcelsud/elastic-search-plugin
Files in marcelsud/elastic-search-plugin
Package elastic-search-plugin
Short Description Elastic search integration for Sylius.
License MIT
Informations about the package elastic-search-plugin
Sylius ElasticSearchPlugin
Usage
-
Install it:
-
Install elastic search server:
-
Run elastic search server:
-
Add those bundles to
AppKernel.php
: -
Create/Setup database:
If there is a problem with creating elastic search index run those commands:
-
Import config file in
app/config/config.yml
for default filter set configuration:For more configuration take a look at ONGRFilterManager
-
Configure ONGR bundle in
app/config/config.yml
: -
Import routing file:
- Example Request/Response:
It's required to pass channel
argument to the search.
To activate filter you need to pass in parameter (query, request, attribute) requested field
see reference in configuration section.
For e.g:
It will activate taxon_slug
, price_range
and channel
filter.
Request:
Response:
- Filtering by attributes:
You need use attributes query parameter which is an associative array where key is the attribute name and value is an array of attribute values. For e.g:
This filter also aggregates all attribute values and it will group them by attribute name Aggregation response from this request:
You can combine filters so for example if you want your products to be filtered in specific locale you can add another query parameter
Example request with locale:
Aggregation response from this request:
Whole response:
- Sorting
-
By name ascending:
-
By price descending:
-
By attribute
ATTRIBUTE_CODE
ascending: - By price ascending, then by name descending:
- Filtering by attribute
-
By attribute name and value:
- By attribute code and value:
- Reindexing Elasticsearch
The current implementation does not support updating Elasticsearch when an entity is updated. In order to stay up-to-date, run the following command:
If you want to recreate the index, run (it will drop it):
All versions of elastic-search-plugin with dependencies
sylius/sylius Version ^1.0@beta
ongr/elasticsearch-dsl Version ^5.0
ongr/elasticsearch-bundle Version ^5.0
simple-bus/symfony-bridge Version ^4.1
ongr/filter-manager-bundle Version ^2.0
ramsey/uuid Version ^3.7