Add Asciifolding filter search to ElasticSearch
Hey here,
For our catalog search, we need to ignore accents. I can easily add the fuzzyquery filter to my search, but I don't have relevant result. I think, the perfect filter should be the Asciifolding, but it seems not to be implemented. How could I add this native ES filter to my Spryker project?!
Thank you for all!
Best Answer
-
You can modify the file
src/Pyz/Shared/Search/Schema/page.json
to add your filter in the filter array in the index settings.
- Delete an index : console elasticsearch:index:delete namespace_store_indexname
- console search:setup:sources
- console search:setup:source-map
- (Execute vendor/bin/console publish:trigger-events to reindex all your data)
After running the search:setup:source-map command, a helper class is autogenerated for every installed index. You can find these classes under the \Generated\Shared\Search namespace
1
Answers
-
You can modify the file
src/Pyz/Shared/Search/Schema/page.json
to add your filter in the filter array in the index settings.
- Delete an index : console elasticsearch:index:delete namespace_store_indexname
- console search:setup:sources
- console search:setup:source-map
- (Execute vendor/bin/console publish:trigger-events to reindex all your data)
After running the search:setup:source-map command, a helper class is autogenerated for every installed index. You can find these classes under the \Generated\Shared\Search namespace
1 -
Thank you very much, I will test that as I can, I'll tell you if everything is ok ;)
0 -
Using this to bring up my suggestion that the ES/OS images should be updated:
(this is not even totally unrelated; you'll probably find that ICU analysis would be really convenient :)
0 -
@Hidran Arias , thanks a lot, that works perfectly :)
0 -
That's great news!
0 -
Just in case you are not aware of the consequences - be careful running this in production enviroment!
This will wipe the whole search until rebuilding the index π
0 -
It's like: " Not to try at home with your kids" !
0 -
I have once managed to update the ES settings and mappings from page.json without deleting the whole index first, but cannot remember how :'(
Technically it should be possible by closing the index, updating, and re-opening, but there was something that needed to be changed in code...
0 -
I did delete the whole index in preprod environment, indeed, rebuild all search is very long, almost an half day⦠So, if can't do this without deleting all indexes, I will do that during the weekend in prod environment, as a B2B platform, that won't be annoying :)
0
Categories
- All Categories
- 42 Getting Started & Guidelines
- 7 Getting Started in the Community
- 8 Additional Resources
- 7 Community Ideas and Feedback
- 75 Spryker News
- 919 Developer Corner
- 779 Spryker Development
- 89 Spryker Dev Environment
- 362 Spryker Releases
- 3 Oryx frontend framework
- 34 Propel ORM
- 68 Community Projects
- 3 Community Ideation Board
- 30 Hackathon
- 3 PHP Bridge
- 6 Gacela Project
- 25 Job Opportunities
- 3.2K π Slack Archives
- 116 Academy
- 5 Business Users
- 370 Docker
- 551 Slack General
- 2K Help
- 75 Knowledge Sharing
- 6 Random Stuff
- 4 Code Testing
- 32 Product & Business Questions
- 69 Spryker Safari Questions
- 50 Random