SearchWP Documentation

View the installation guide, browse the Knowledge Base, find out about SearchWP’s many hooks

searchwp\query\partial_matches\fuzzy\force

Since: 4.0.0

Table of Contents

By default (when partial matching is enabled) SearchWP will apply two levels of partial matching logic. The first will be the application of direct partial matches, and if no partial matches are found another level of fuzzy logic will be applied.

This hook can force that fuzzy logic to be applied even if partial matches have been found.

Parameters

Type Parameter Default Since
Boolean $enabled false 4.0.0

Examples

All hooks should be added to your custom SearchWP Customizations Plugin.

Force fuzzy matches to be found

Force SearchWP to find fuzzy matches even if partial matches are found (which would normally not happen)

<?php
// Force SearchWP's fuzzy logic to be applied even when partial matches are found.
add_filter( 'searchwp\query\partial_matches\fuzzy\force', '__return_true' );

How to use this code