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

Reply To: Disable Searching 'Ending with' for Index Table

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Disable Searching 'Ending with' for Index Table Reply To: Disable Searching 'Ending with' for Index Table

#19803
Ernest MarcinkoErnest Marcinko
Keymaster

Hi,

That query is redundant in my opinion, because the first part (before the OR) is included within the second part. Wildcard searches using the ‘%’ symbol, mean, that there is either anything before the phrase or nothing. Basically ‘%phrase%’ includes the matches from ‘phrase%’ as well.
The performance degradation is because of the ‘%phrase%’ double wildcard query, as that cannot be performed as an indexed query by the database engine. Only the starting with queries (aka ‘phrase%’) can be performed as indexed (huge performance difference).
So changing the $wcl to an empty string, and not adding any additional code will give you the fastest possible results in this case.