Note: You are viewing the documentation for Version 3View Version 4 Docs

Documentation

View the installation guide, browse the Knowledge Base, find out about SearchWP's many hooks, get support

Available since: 1.3.2

searchwp_and_logic

When SearchWP performs a search it takes a first pass at the index using AND logic if multiple terms are present. It often reduces the potential results pool generating more limited (but more relevant) results. If no results are found during the AND pass, SearchWP will take another pass at the index using OR logic, which is more resource intensive and includes a larger pool of results.

If you would like to skip the AND pass you can use this filter to do so.

Example: To have SearchWP skip checking for AND results, add the following to your active theme’s functions.php:

<?php
add_filter( 'searchwp_and_logic', '__return_false' );
view raw gistfile1.php hosted with ❤ by GitHub
Fix keyword search on your site. No coding required!

Now you can utilize all of the content that's gone unrecognized by native WordPress keyword search instantly with SearchWP

Get SearchWP