Search only finds exact matches 8.1.0

Permalink
Hi,

I am running 8.1.0 and I am trying to get the search block to actually work properly, like you would expect a site search to work.

For example:

I have multiple pages with 'Adele Tribute Act' as the description.

If i search for Adele, all the adele pages come up which is great.

If i search for Adele Tribute, it works fine BUT if i search for Adele act.... nothing shows??

Surely I can't be the only person that finds this an issue? There are so many discussions covering the search functionality or lack of in c5 but nothing that covers version 8?

helenmarie
 
hutman replied on at Permalink Best Answer Reply
hutman
Unfortunately this is always the way that the Concrete5 search has worked. You can fix this by copying /concrete/blocks/search/controller.php to /application/blocks/search/controller.php fixing the namespacing, and then changing this code

if ($query !== '') {
    $ipl->filterByKeywords($query);
}

to
if ($query !== '') {
    $words = explode(' ', $query);
    $queryParsed = implode('%', $words);
    $ipl->filterByKeywords($queryParsed);
}
pekka replied on at Permalink Reply
pekka
This is one C5 design decision that I've never understood. I can think of *no* situation where this is the expected/desired behaviour on the user's end.

Oh well. At least it seems easy enough to fix now, easier than it used to be IIRC. Although it'd probably still not be trivial to introduce fulltext search.
helenmarie replied on at Permalink Reply
helenmarie
Thank you so much for your help! This fixed the issue. This should be included in the core code!