Search only finding exact matches - not multiple keywords
Permalink
Hi
I saw a lot of old posts about this issue but could not find a real solution.
I have a hard coded search resulting on a specific search result page and it only works for individual words or exact phrases.
Did anybody find a solution to being able to search for several keywords and get results for each keyword?
The site deals with artists in Vegas and if someone types in "clown las vegas" we need to find clowns in Vegas (obviously)
I realize that the search would have to crawl through attributes as well as page content and has to be really clever (certainly more clever than me...)
Anybody?
Thanks
I saw a lot of old posts about this issue but could not find a real solution.
I have a hard coded search resulting on a specific search result page and it only works for individual words or exact phrases.
Did anybody find a solution to being able to search for several keywords and get results for each keyword?
The site deals with artists in Vegas and if someone types in "clown las vegas" we need to find clowns in Vegas (obviously)
I realize that the search would have to crawl through attributes as well as page content and has to be really clever (certainly more clever than me...)
Anybody?
Thanks
Splitting keywords and searching for them individually is certainly possible, here's one place where that would have to happen:
https://github.com/concrete5/concrete5/blob/master/web/concrete/core...
As you can see there, the parameter $keywords is simply passed on to the SQL query.
There are different approaches to this:
* Modify the code mentioned above and probably a few more things
* Use the previously built search engine based on Lucene
* Use something completely different like Google CSE
Lucene requires quite a bit of concrete5 knowledge, CSE doesn't require much knowledge at all and the first solution requires a bit of PHP and SQL knowledge.
Certainly possible, but I don't think there's a solution available out of the box!