You are here:  » Wheres my search result? :(

Support Forum



Wheres my search result? :(

Submitted by trigger571 on Sat, 2007-03-03 22:58 in

Hi David,

Still playing around with this great script, as I didnt get much time to work on it recently. I've now encountered quite a strange problem. If you have a look at http://www.boatingholidays.me.uk and type the words "Norfolk Broads", or even seperatly, you get 0 results. This is driving me crazy as I know they are in the database. they are also the only ones which are not showing up. Any other keyword comes up quite merrylie. So whats the prolem, and more importantly, have you any idea of how I can get it to work, as its my most important keyword?

Cheers

Marcel

Submitted by support on Sun, 2007-03-04 08:59

Hello Marcel,

I think you have hit the 50% rule with the term "Norfolk Broads" which means that MySQL has not indexed the term in the full text index. It doesn't consider words that appear too often to be worth indexing, which in general leads to better performance.

Obviously that does not apply in your case as Norfolk and Broads are very key words in your data set. The easiest way to work around this is to not use the full text index and edit the script to use the basic search method for all queries instead.

The decision to use the full text index is made in the following code on line 63 of search.php

if (strlen($parts[0]) > 3)

(this is because as well as the 50% rule words under 3 characters are not indexed by the full text indexer)

To force the basic search for all queries, change this line to:

if (0)

Hope this helps,
Cheers,
David.

Submitted by trigger571 on Sun, 2007-03-04 10:52

Thanks David,

But now I have the opposit problem. I can find "Norfolk" and "Broads" as single keywords, but not as join. Most keyword searches would be joint searches such as "Norfolk Broads" or "River Thames". So really I am now worse off. Any other solution?

Cheers

Marcel

Submitted by support on Sun, 2007-03-04 10:57

Hi Marcel,

Sorry - this has come up before and is easily fixed. It happens because the basic search method works against a space removed version of the product name, so when using this method with longer words you need to remove spaces from the query.

To do this, recall in my last post that you made this change:

if (0)

Add the line of code from the following block to this (on the line before) giving you:

$parts[0] = str_replace(" ","",$parts[0]);
if (0)

This will remove spaces, and you should then find that a search for "Norfolk Broads" works fine...

Cheers,
David.

Submitted by trigger571 on Sun, 2007-03-04 11:12

You are my HERO :) - How mny sites is the licence valid for Dave? I intend to run it on multiples, so if I need multiple licences please let me know :)

Submitted by support on Sun, 2007-03-04 11:15

Hiya,

Glad that's got you working!

You can run the script on as many of your own sites as you like (many users create large categorised sites by running installations in sub-directories) - but you can even install on another server if you want...

Cheers,
David.