Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Search - Case sensitivity


Reply


4 Posts   1483 Views

Avatar
FullWebService

Community Member, 38 Posts

8 May 2010 at 11:50pm

Edited: 09/05/2010 11:12pm

I'm using a basic search form with SS2.4 with the following code:

   function SearchForm() {
      $searchText = isset($_REQUEST['Search']) ? $_REQUEST['Search'] : 'Search';
      $fields = new FieldSet(
       new TextField("Search", "", $searchText)
       );
      $actions = new FieldSet(
       new FormAction('Results', 'Search')
       );

       return new SearchForm($this, "SearchForm", $fields, $actions);
   }
   
   function Results($data, $form){
      $data = array(
       'Results' => $form->getResults(),
       'Query' => $form->getSearchQuery(),
       'Title' => 'Zoek resultaten'
       );
      return $this->customise($data)->renderWith(array('Page_results', 'Page'));       
   }

With that I get te following error:

[User Error] Couldn't run query: SELECT ClassName, "SiteTree_Live".ID, ParentID, Title, MenuTitle, URLSegment, Content, LastEdited, Created, _utf8'' AS Filename, _utf8'' AS Name, MATCH (Title, MenuTitle, Content, MetaTitle, MetaDescription, MetaKeywords) AGAINST ('test') + MATCH (Title, MenuTitle, Content, MetaTitle, MetaDescription, MetaKeywords) AGAINST ('test') AS Relevance, CanViewType FROM "SiteTree_Live" WHERE ( MATCH (Title, MenuTitle, Content, MetaTitle, MetaDescription, MetaKeywords) AGAINST ('test*' IN BOOLEAN MODE) + MATCH (Title, MenuTitle, Content, MetaTitle, MetaDescription, MetaKeywords) AGAINST ('test*' IN BOOLEAN MODE) AND ShowInSearch 0) UNION SELECT ClassName, "File".ID, _utf8'' AS ParentID, Title, _utf8'' AS MenuTitle, _utf8'' AS URLSegment, Content, LastEdited, Created, Filename, Name, MATCH (Filename, Title, Content) AGAINST ('test') AS Relevance, NULL AS CanViewType FROM "File" WHERE (MATCH (Filename, Title, Content) AGAINST ('test*' IN BOOLEAN MODE) AND ClassName = 'File') ORDER BY Relevance DESC LIMIT 0, 10 Can't find FULLTEXT index matching the column list

I don't really have any more info, as I simply don't get it. Can anyone give me a hand?

TIA.

Avatar
ajshort

Community Member, 244 Posts

9 May 2010 at 1:22am

http://doc.silverstripe.org/upgrading:2.4.0#fulltext_search_and_indexes_disabled_by_default

Avatar
FullWebService

Community Member, 38 Posts

9 May 2010 at 2:07am

Oh, bloody hell...

Thanks so much!

Avatar
FullWebService

Community Member, 38 Posts

9 May 2010 at 11:13pm

Ok, new search issue.

I noticed that the search is case sensitive. Is there a way around this?