This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Reply To: Partial matching starts with

#39024
Ernest MarcinkoErnest Marcinko
Keymaster

Hi,

Well the problem with this is, that partial matching works the other way around, the phrase is partial matched agains the content. Otherwise all words from all of the posts and all of the fields would have to be matched agains the keyword to see if it partial matches – which is of course not possible.

Theoretically, I can suggest a small custom code snippet, which “breaks” the search phrase at the character position 4, by adding a space character to it.

Try adding this code to the functions.php file in your theme/child theme directory – make sure to have a full server back-up first for safety. For more details you can check the safe coding guidelines.

add_filter('asp_query_args', 'asp_query_args_search_at_four', 10, 1);
function asp_query_args_search_at_four($args) {
	$args['s'] = substr_replace($args['s'], ' ', 3, 0);
	return $args;
}