From 0ce07eb9cd86acc4fb0c6cb6c8ecbd003e2347bc Mon Sep 17 00:00:00 2001 From: Sam Minnee Date: Thu, 7 May 2009 04:30:37 +0000 Subject: [PATCH] BUGFIX: Fixed searchform to work with reduced number of indexes git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@76354 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- search/SearchForm.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/search/SearchForm.php b/search/SearchForm.php index 3eda191c1..4b01785cf 100755 --- a/search/SearchForm.php +++ b/search/SearchForm.php @@ -197,14 +197,14 @@ class SearchForm extends Form { if($keywords) { $match['SiteTree'] = " MATCH (Title, MenuTitle, Content, MetaTitle, MetaDescription, MetaKeywords) AGAINST ('$keywords' $boolean) - + MATCH (Content) AGAINST ('$htmlEntityKeywords' $boolean) + + MATCH (Title, MenuTitle, Content, MetaTitle, MetaDescription, MetaKeywords) AGAINST ('$htmlEntityKeywords' $boolean) "; $match['File'] = "MATCH (Filename, Title, Content) AGAINST ('$keywords' $boolean) AND ClassName = 'File'"; // We make the relevance search by converting a boolean mode search into a normal one $relevanceKeywords = str_replace(array('*','+','-'),'',$keywords); $htmlEntityRelevanceKeywords = str_replace(array('*','+','-'),'',$htmlEntityKeywords); - $relevance['SiteTree'] = "MATCH (Title) AGAINST ('$relevanceKeywords') + MATCH(Content) AGAINST ('$htmlEntityRelevanceKeywords') + MATCH (Title, MenuTitle, Content, MetaTitle, MetaDescription, MetaKeywords) AGAINST ('$relevanceKeywords')"; + $relevance['SiteTree'] = "MATCH (Title, MenuTitle, Content, MetaTitle, MetaDescription, MetaKeywords) AGAINST ('$relevanceKeywords') + MATCH (Title, MenuTitle, Content, MetaTitle, MetaDescription, MetaKeywords) AGAINST ('$htmlEntityRelevanceKeywords')"; $relevance['File'] = "MATCH (Filename, Title, Content) AGAINST ('$relevanceKeywords')"; } else { $relevance['SiteTree'] = $relevance['File'] = 1;