SearchWP

LIKE Terms

Current version: 2.4.6 View Changelog

Download available with active license

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

Unlike Fuzzy Matches, LIKE Terms does not perform primitive spell checking at all. This is useful if you’re looking to allow partial matching of terms, without exposing close spelling variants which can cause performance issues in the wrong circumstances.

For example, you should use LIKE Terms instead of Fuzzy Matches if you’re looking to incorporate SKU searching and want to allow for partial term matches without exposing thousands of similarly “spelled” SKUs that would be included with Fuzzy Matches.

Filters

There are a number of filters to help with your LIKE Terms implementation:

searchwp_like_min_length
Customize the minimum length of a word for LIKE matching to be applied. Default is 4, to customize:

<?php
// Apply LIKE matching for terms 2 or more characters in length.
function searchwp_like_min_length( $length ) {
return 2;
}
add_filter( 'searchwp_like_min_length', 'my_searchwp_like_min_length' );
view raw functions.php hosted with ❤ by GitHub

searchwp_like_stem
Customize whether SearchWP applies LIKE matching to the keyword stem regardless of engine setting. Default is false, to customize:

<?php
// Control whether SearchWP uses the keyword stem when finding LIKE terms.
function my_searchwp_like_stem( $stem, $terms, $engine ) {
// Return true/false (default is false)
}
add_filter( 'searchwp_like_stem', 'my_searchwp_like_stem', 10, 3 )
view raw functions.php hosted with ❤ by GitHub

searchwp_like_wildcard_before
Customize whether SearchWP implements a LIKE wildcard before search terms. Default is true, to disable:

<?php
// Prevent SearchWP LIKE Terms from using a LIKE wildcard before search terms
add_filter( 'searchwp_like_wildcard_before', '__return_false' );
view raw functions.php hosted with ❤ by GitHub

searchwp_like_wildcard_after
Customize whether SearchWP implements a LIKE wildcard after search terms. Default is true, to disable:

<?php
// Prevent SearchWP LIKE Terms from using a LIKE wildcard after search terms.
add_filter( 'searchwp_like_wildcard_after', '__return_false' );
view raw functions.php hosted with ❤ by GitHub

Changelog

2.4.6

  • [Fix] Fixes PHP Warning

2.4.5

  • [Fix] Better handling of minimum character count
  • [New] New filter searchwp_like_wildcard_before allows control over partial matching before terms (default is true)
  • [New] New filter searchwp_like_wildcard_after allows control over partial matching after terms (default is true)
  • [Update] Updated updater

2.4.4

  • [Fix] Fixed an issue that prevented exclusive regex matches from being properly restricted

2.4.3

  • [Fix] Fixed a regression introduced in 2.4.2

2.4.2

  • [Fix] Fixed an issue with multiple terms
  • [Update] Updated updater

2.4.1

  • [Fix] Better stemming support

2.4

  • [New] New filter searchwp_like_stem allows developers to restrict LIKE matches to the term(s) (as opposed to term(s) and stem(s))
  • [Improvement] Support for automatic updates based on your SearchWP license key

2.1

  • [Change] Also use keyword stems to find LIKE terms

2.0

  • [Change] No longer force-disable AND logic
  • [Change] Updated to the new filter structure

1.0

  • 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

  • “SearchWP delivers the search experience WordPress should out of the box. The way it combs through Advanced Custom Fields (ACF) is class leading. It’s an excellent product and a terrific value.”

  • “We have been looking for a solution that also includes a similarity search and typo correction. With SearchWP we have found exactly that. Download, install, done.”

  • “SearchWP is the best of multiple search plugins I’ve tried. Running a complex content site, being able to rank types of content differently, or even have a separate search engine with its own index for a more specific part of the site, is invaluable.”