Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Search logic
This topic contains 1 reply, has 2 voices, and was last updated by Ernest Marcinko 7 years, 2 months ago.
- AuthorPosts
- June 27, 2017 at 3:12 am #13800
I’m not understanding the search logic (and I’ve studied the documentation page on it thoroughly.)
General Options > Sources
Regular engine
Search in posts > on
Search in titles > on
all others offGeneral Options > Logic and Behavior
Primary keyword logic: And
Show exact matches only? OffFront-end search settings > General
Default checkboxes
Show exact matches selector? > on
Show search in title selector? > on
Show search in content selector? > on
comments/excerpt offSo when I go to my homepage, and click the selector icon,
Exact match > not checked
Search in title > checked
Search in content > not checkedAs expected. So, with the above default settings, I search for “pass”. I’d expect to get posts with titles that have words containing “pass” in them.
I get 36 results. Most have the word Passions in the title, but at least one has the exact word, pass. Makes sense.I pull down the selector and select Exact matches. Now I’d expect to get only those posts with the word “pass” in them. But I get all 36 posts, including those with the word “passion” but not just the word “pass” in them!
I thought it might be because of my Secondary logic being set to OR. So I changed that to disabled – and I get the same result.
So, the “exact matches” selector does not seem to be working…or I’m not understanding it.
June 27, 2017 at 8:31 am #13802Hi!
The exact matches does not work like that, mostly because of the limitations on how the information is stored. Word boundaries cannot be reliably detected within the database, so there is no possibility to use exact matches that way.
Exact matching is more useful in scenarios where the user types in more than 1 keyword. Exact matching means in this case, that the phrases are not separated, but treated as one, and matched against the database content.
If you want exact word matching, then my suggestion would be:
1. Configuring and enabling the index table engine first. This step is vital, as it allows detecting word boundaries in a better way, without putting much load on the database itself.
2. Using the following logic configuration: https://i.imgur.com/WWtF9tx.png
You can even try without the secondary locig, if you have lots of records in the database.This will make sure to match exact words, if no matches, then randomly, but all words must match in both cases.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
- AuthorPosts
You must be logged in to reply to this topic.