Adding FuzzyQueryExpanderPlugin to Catalog Search Results

fabrice.dhuicque
fabrice.dhuicque Spryker Solution Partner Posts: 19 🧑🏻‍🚀 - Cadet

Hi here,

I'm trying to make fuzzy our search on our app.

I've succeeded to add it for suggestions, but not for result.

For Suggestions, I've simply added this plugin to CatalogDependencyProvider:createSuggestionQueryExpanderPlugins()

Logically, I've added it to CatalogDependencyProvider:createCatalogSearchQueryExpanderPlugins() but it throws an error and returns the whole catalog (the error is nothing else than an alert bar "catalog.page.cannot_be_opened" ). I've tried in other methods which doesn't make it better.

What am I supposed to do to make it working fine ? (I didn't find any relevant documentation, so if you have some, I'll take it ;) )

Than you in advance!

Best Answer

  • fabrice.dhuicque
    fabrice.dhuicque Spryker Solution Partner Posts: 19 🧑🏻‍🚀 - Cadet
    Answer ✓

    Found a solution : we need to extend the CatalogSearchQueryPlugin.php:createMultiMatchQuery and replace TYPE_CROSS_FIELD by TYPE_BEST_FIELDS.

Answers

  • fabrice.dhuicque
    fabrice.dhuicque Spryker Solution Partner Posts: 19 🧑🏻‍🚀 - Cadet
    Answer ✓

    Found a solution : we need to extend the CatalogSearchQueryPlugin.php:createMultiMatchQuery and replace TYPE_CROSS_FIELD by TYPE_BEST_FIELDS.