Search block improvement

Permalink
Search block by default doesn't search the meta fields (although they are indexed), so to fix that the database_indexed_search library has to be modified. I've modified the query to include meta fields and I'm concatenating '*' to the end of the keywords to solve the problem when you have "cats" on the page but the search for "cat" returns nothing. Modified file is in attachment, if you want to use it change the extension to php and put it in library folder in your concrete installation root. The search would probably work faster if the indexing job would fill only one table with meta fields, title, description and content then that ugly subquery could be removed from the search… I hope this will be improved in the future releases.

1 Attachment

 
zoki replied on at Permalink Reply
version of c5
Mnkras replied on at Permalink Reply
Mnkras
wow thanks!

im guessing you got the cats and cat from my post :)
zoki replied on at Permalink Reply
It's a good example and I was too lazy to make my own example... :)
zoki replied on at Permalink Reply 1 Attachment
join in the query is wrong, I've fixed it so the search results should be correct this time... Just replace the old file with new one.
brennaH replied on at Permalink Reply
brennaH
thanks for putting this out there -- anyone know if custom page attributes are indexed?
zoki replied on at Permalink Reply
when creating (or editing) a custom page attribute "Yes, include this field in the search index.". If you check it will be indexed... :)
brennaH replied on at Permalink Reply
brennaH
The index search engine (/libraries/database_indexed_search.php) is somehow failing to write data into the 'content' field of the PageSearchIndex table in the DB. I haven't altered the code in any way.

I've been over and and over the functions here and I can't determine where it is failing. It appears to be the private function getBodyContentFromPage($c).

Has anyone else had this problem? I've added any custom areas to the array of searchableAreaNames -- and in any case I have areas of the site called "Main".
andrew replied on at Permalink Reply
andrew
Brenna - could you remind me which version of concrete5 you're using?
brennaH replied on at Permalink Reply
brennaH
Just upgraded yesterday. I'd check to see if the issue were resolved with the upgrade, but somehow I've got that process running (index_search.php) and I seem to be unable to kill it. Know a good hitman?