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've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Archive /

Our old forums are still available as a read-only archive.

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

Problems with Site Search


Go to End


2 Posts   1363 Views

Avatar
nomen

Community Member, 52 Posts

4 July 2008 at 3:01am

Edited: 04/07/2008 3:19am

Hi all:

I have built the search function following the instructions in 4-site-search
But there are some problems:

1) The content is saved by TinyMCE using HTML. The main language is spanish, so if i want to found comisión the content with the word comisión is not finded.

2) To solve this I decided to change the code in sapphire/search/SearchForm.php in function getResults from

	$keywords = $_REQUEST['Search'];
to
$keywords = $_REQUEST['Search']; $keywords .= " OR " . htmlentities($keywords);
with the idea to search twice. Now it searches in content... but also searched in sites where is not tha word :-D. It also searches in files (and i don´t know how it does it) and gives me as result, but the word is not in...

3) If i try to search when i am not in the main language in the site, it gives me an error... I have solved this with this pacth.

4) The problem now is that the seach only finds in the main site language (SiteTree_Live). If I write content in a second language and I try to find it, it does not find it. I think that the correct behaviour should be to search the content in the current language.

If this problem only mine? The search is not tested in SS?
Thanks in advance.

Avatar
Sam

Administrator, 690 Posts

7 July 2008 at 1:03pm

Edited: 07/07/2008 1:04pm

Hi nomen,

The search system has been tested a fair bit, but I think that the issues that you're having are related to the use of search specifically with multilingual sites.

It sounds like this issue - http://open.silverstripe.com/ticket/2267 - is related to your problem. If you add your email address to the CC field of the ticket, you will be notified when we fix it.

Also, the change you made to get the é being searched for is probably causing problems. Rather than editing $keywords, you should try making a patch in the searchEngine() method to fix this.