SearchWP

Fuzzy Matches

Current version: 1.4.4 View Changelog

Download available with active license

⚠️ Note: This extension is DEPRECATED as of SearchWP version 3.0 and will be removed soon ⚠️

Fuzzy matching aims to make SearchWP a bit more lenient with search queries. Use this extension to include search terms that are close in spelling to terms within your index. There are some filters available for this Extension that let you fine-tune how loose the fuzziness is.

Note: Please read these notes before installing Fuzzy Matches

Using Fuzzy Matches is recommended only in circumstances that deem it necessary. This warning is given because Fuzzy Matches essentially reduces the effectiveness of SearchWP’s algorithm. Fuzzy Matches broadens search terms which can essentially bring in unwanted results.

It is recommended that you first monitor your actual search queries using SearchWP’s built-in statistics. Using this data you can evaluate what search terms are yielding zero results. The first step here would be to install Term Synonyms if these failed searches are due to common misspellings.

If there are too many common misspellings to make managing Term Synonyms feasible, then (and only then) would Fuzzy Matches be a recommended solution.

searchwp_fuzzy_min_length
Set the minimum word length to include in fuzzy matches (default is 5)

<?php
function my_fuzzy_word_length()
{
return 5;
}
add_filter( 'searchwp_fuzzy_min_length', 'my_fuzzy_word_length' );
view raw gistfile1.php hosted with ❤ by GitHub

searchwp_fuzzy_threshold
Beyond basic fuzzy matching, SearchWP will apply some primitive spell checking to submitted terms. This filter lets you specify what minimum percentage should be used to constitute a valid match. Must be 0 – 100. (default is 80)

<?php
function my_fuzzy_threshold()
{
return 85;
}
add_filter( 'searchwp_fuzzy_threshold', 'my_fuzzy_threshold' );
view raw gistfile1.php hosted with ❤ by GitHub

searchwp_fuzzy_digit_threshold
Set the maximum percentage of digits in search term to perform spell checking (default is 10)

<?php
function myChangeDigitThreshold()
{
return 15; // 15% maximum threshold
}
add_filter( 'searchwp_fuzzy_digit_threshold', 'myChangeDigitThreshold' );
view raw gistfile1.php hosted with ❤ by GitHub

Changelog

1.4.4

  • [Update] Updated updater

1.4.3

  • [New] New filters searchwp_fuzzy_prefix and searchwp_fuzzy_suffix to refine control over partial matches
  • [Update] Updated author
  • [Update] Updated updater

1.4.2

  • [Fix] Fixed a regression that caused Fuzzy Matches' algorithm to fail in some cases

1.4

  • [Improvement] Better term prep
  • [Change] Adjusted priority for better interoperation with other SearchWP Extensions

1.3

  • [Improvement] Support for automatic updates based on your SearchWP license key

1.2

  • [Improvement] Don't find fuzzy matches if the search term exists
  • [Change] Now requires at least SearchWP 2.4.11

1.1

  • [Change] Use searchwp_term_in filter
  • [Change] Now requires at least SearchWP 2.0.3

1.0

  • [Fix] Better match restriction
  • [Fix] Fixed an issue with checking digit ratio

0.3

  • Initial release

Want to make your search awesome right now?

More than 30,000 sites have chosen SearchWP!

You can utilize all of the content that’s gone unrecognized by native WordPress keyword search instantly with SearchWP.

Get SearchWP for just $99

  • Committed Support
    If you need help, support is fast, friendly, and here for you
  • Streamlined Setup
    Installation and setup that’s optimized for speed
  • Great Documentation
    Helpful, clear, and usable documentation is a priority

See what SearchWP customers have to say

  • “We’ve been using SearchWP on our Knowledge Base for the past few months, and it has made a significant difference for our clients. It’s helped reduce the number of support tickets because people can find what they’re looking for, and we also love the metrics and seeing trends in searches. If you want people to find things on your site, it’s the best and I highly recommend SearchWP!”

  • “SeachWP is easy to set up and has all the customizing I need to help my clients deliver a better search experience than the native WP search functionality. It also has great analytics that help their content strategy.”

  • “The plugin do all what we need – and the support is GREAT! Helped me in many questions and at PHP-code! THANKS!”