Calling Developers!
We are reenergizing our code contribution process! Learn More

Adding FuzzyQueryExpanderPlugin to Catalog Search Results

Options
fabrice.dhuicque
fabrice.dhuicque Spryker Solution Partner Posts: 6 🧑🏻‍🚀 - 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: 6 🧑🏻‍🚀 - Cadet
    Answer ✓
    Options

    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: 6 🧑🏻‍🚀 - Cadet
    Answer ✓
    Options

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