Search fuzziness explained

Search term fuzziness allows the user to have typos or use different verb tenses and still get results. This is done by using algorithms that are based on similarity rather than exact matches. While the benefits of the feature is pretty clear, there are situations where fuzziness can lead to unwanted search behavior. Let’s explore these and also check out how fuzzy search can be disabled.

What are the possible unwanted behaviors?

Generally speaking, fuzziness generates more results. This is due to the fact that in addition to exact matches, similar matches are also considered relevant.

Consider the case of search term “dog”, when fuzziness is enabled the term would also match dogs, does, hogs and mog and with more similarity distance even mug. The search results are ordered based on fuzzy distance sor these results will appear later in the results list. At the same time, some of these (now considered) relevant matches are not semantically relevant.

Also consider the case that the search query doesn’t have any exact matches but there are some fuzzy results. Depending on the term being queried, the results might not have any relevant results

How to disable search fuzziness entirely?

Fuzzy search is enabled by default. You can disable this feature entirely with the following custom code.

				
					
add_filter( 'eprobe_post_match_fuzziness', '__return_zero' );

				
			

You can learn more about enhancing ElasticProbe with custom code in this article.