Jump to:

23367 Posts in 18143 Topics by 2863 members

General Questions

SilverStripe Forums » General Questions » Search - Case sensitivity

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

Page: 1
Go to End
Author Topic: 1421 Views
  • FullWebService
    Avatar
    Community Member
    38 Posts

    Search - Case sensitivity Link to this post

    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.

  • ajshort
    Avatar
    Community Member
    244 Posts
  • FullWebService
    Avatar
    Community Member
    38 Posts

    Re: Search - Case sensitivity Link to this post

    Oh, bloody hell...

    Thanks so much!

  • FullWebService
    Avatar
    Community Member
    38 Posts

    Re: Search - Case sensitivity Link to this post

    Ok, new search issue.

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

    1421 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.