You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+49-20Lines changed: 49 additions & 20 deletions
Original file line number
Diff line number
Diff line change
@@ -111,37 +111,43 @@ There is searchbar in the header of the shop.
111
111
<img src="doc/es_browser.png" />
112
112
</div>
113
113
114
-
You can easily modify it by overriding the `@BitBagSyliusElasticsearchPlugin/Shop/Menu/_searchForm.html.twig`template or disable it by setting:
114
+
You can easily modify it by overriding the `@BitBagSyliusElasticsearchPlugin/Shop/Layout/Header/searchForm.html.twig`and templates `@BitBagSyliusElasticsearchPlugin/Shop/SearchForm/searchForm.html.twig` or disable it by setting:
When you go now to the `/{_locale}/products-list/{taxon-slug}` page, you should see a totally new set of filters. You should see something like this:
133
+
When you go now to the `/{_locale}/taxons/{slug}` page, you should see a totally new set of filters. You should see something like this:
127
134
128
135
<div align="center">
129
136
<img src="doc/es_results.png" />
130
137
</div>
131
138
132
-
You might also want to refer the horizontal menu to a new product list page. Follow below instructions to do so:
133
-
134
-
1. If you haven't done it yet, create two files:
135
-
* `_horizontalMenu.html.twig` in `templates/bundles/SyliusShopBundle/Taxon` directory
136
-
* `_breadcrumb.html.twig` in `templates/bundles/SyliusShopBundle/Product/Show` directory
137
-
2. Paste into those files content of respectively `vendor/sylius/sylius/src/Sylius/Bundle/ShopBundle/Resources/views/Taxon/_horizontalMenu.html.twig` and `vendor/sylius/sylius/src/Sylius/Bundle/ShopBundle/Resources/views/Product/Show/_breadcrumb.html.twig` files, replacing `sylius_shop_product_index` with `bitbag_sylius_elasticsearch_plugin_shop_list_products` in both of them.
138
-
3. Clean your cache with `bin/console cache:clear` command.
139
-
4. :tada:
139
+
It is important that the `routing.yml` from the plugin are loaded before `sylius_shop`:
140
140
141
-
If you're using vertical menu - follow steps above with `_verticalMenu.html.twig` file instead. It's in the same directory as the `_horizontalMenu.html.twig` file.
142
-
143
-
**Be aware! Elasticsearch does not handle dashes well. This plugin depends on the code field in Sylius resources. Please use underscores instead of dashes in your code fields.**
### Excluding options and attributes in the filter menu
146
152
147
153
You might not want to show some specific options or attributes in the menu. You can set specific parameters for that:
@@ -212,6 +218,29 @@ fos_elastica:
212
218
213
219
Indexes with `bitbag_shop_product`, `bitbag_attribute_taxons` and `bitbag_option_taxons` keys are available so far.
214
220
221
+
### Search fuzziness
222
+
223
+
>Fuzziness in Elasticsearch is a feature that allows search queries to match terms even if there are minor typos or spelling mistakes.
224
+
It works by calculating the Levenshtein distance (edit distance) between the query term and indexed terms, enabling the search engine to find similar words—for example, a search for “aple” can still match “apple.”
225
+
Fuzziness is commonly used in full-text search to improve result accuracy despite small user input errors.
226
+
227
+
You can set the fuzziness of the search by overriding the `bitbag_sylius_elasticsearch_plugin.query_builder.contains_name` service in your service file `(min. -> 0, max. -> 2)`:
0 commit comments