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

  • “Outstanding support. We were able to get really good tailored search results using SearchWP. Give it a go and if you get stuck, use the FAQs and support and you’ll be fine.”

  • “SearchWP is the booster WP needs. It converts search in what it should be. Great plugin!”

  • “We use SearchWP also on pages with a great number of subpages, articles, custom post types and fields. SearchWP works always reliable and offers great statistics for the admins – we love it.”