Reply To: Search matching only ends of strings

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Search matching only ends of strings Reply To: Search matching only ends of strings

#6868
Ernest Marcinko
Ernest Marcinko
Keymaster

Hi!

“search “123” shows 30+ posts but the first results only contain 1 match while the target post has more then 45 matches and is shown 17th in the list”

The issue with the regular engine is, that it cannot count matches. For example a result with 100 matches in the content, and another with only 1 match in the content gets the same relevance. There is no way around it. Implementing a counting mechanism is not an option, since it’s extremely performance heavy operation in this case.

I strongly suggest to consider using the Index Table engine. It basically generates a database table with all the words in all the matching posts and fields. The great thing is however, that this solves the counting problem. Because it is a list of indexed keywords, it stores the occurences of each keyword in each field – so the calculation of the relevance is very precise.

Another great thing is that you won’t need that custom code, as keywords extracted from content or custom fields are treated equally on the database level. In the latest version of the plugin (4.6) I’ve added a few new options to the relevance panel, where it is now possible to adjust the Index table relevance values separately. I’ve also implemented an adjustable primary and a secondary ordering, to clear the smoke around relevance-data ordering problems.

Best,
Ernest Marcinko

If you like my products, don't forget to rate them on codecanyon :)