Hey guys
Been using Modx now for a couple of years. I’ve recently finished a project with included ajaxsearch.
The issue we’re having is that the search is just too sensitive.
For example, a search for Air will bring up results for Chair.
Is there anyway to lower this sensitivity to allow the search to only pick up whole words, and not just parts?
Thanks for any advice!
-
☆ A M B ☆
- 2,475 Posts
You can write MySQL queries that look for whole word matches, but that’s just not how the Ajax Search queries are programmed.
-
☆ A M B ☆
- 2,475 Posts
Thanks for the link. Yeah, I’ve seen full text searches in action, but I didn’t realize MySQL had a whole set of operations set aside for them. I think they’re most useful if you’ve got a set of stop-words (e.g. "and", "the", etc)... for searching a single site, the REGEXP may be the way to go...
a dirty trick may be to put a space before the searchword. this way you will find all words that are equal to ’ air’, with exact word combination, this may be able to work? Dont use a space after, because you will ignore words on the end of a sentence, because they normally have a . or ! or ? etc.
It may be easier to implement:)