SearchWP Documentation

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

searchwp\query\partial_matches\did_you_mean

Since: 4.0.0

Table of Contents

Control whether SearchWP’s performs “Did you mean?” style corrections to searches that apply partial matching logic.

Parameters

Type Parameter Default Since
Boolean $enabled true 4.0.0
Array $args
Key Type Value
tokens Array Tokens for this search
query \SearchWP\Query The Query taking place
4.0.0

Examples

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

Disable "Did you mean?" functionality

Disable “Did you mean?” functionality

<?php
// Disable SearchWP's "Did you mean?" functionality.
add_filter( 'searchwp\query\partial_matches\did_you_mean', function( $enabled, $args ) {
return false;
}, 10, 2 );

How to use this code