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
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.