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.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

General Questions /

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

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

Search - Case sensitivity


Go to End


4 Posts   1864 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
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?