You are here:  » Search optimisation

Support Forum



Search optimisation

Submitted by Klyde on Fri, 2008-12-19 12:51 in

Hello,
I found something very strange in the search result.

I have test with a search on "Nea" keyword. I have 6 pages of results but product "Nea Blanc" and "Nea Noir" are on page 4 and 5!

On the first page I have "Alterno" "Anneau avec picots et pendentif" etc...

Why product with the exact keyword are ranked after product with keyword in just a part of the name? Is it because "Nea Blanc" and "Nea Noir" are mapped products? How can I make it better?

You can test it here: {link saved}

Submitted by support on Fri, 2008-12-19 12:58

Hi Klyde,

This is a trade-off i'm afraid; as MySQL's Full Text index does not index words less than 4 characters (for performance reasons); so when the query contains shorter words; a basic LIKE query is used which doesn't have the same relevance sorting i'm afraid.

One option is to change the basic search method (when the full text index is not used) to show only products that contain the exact text (at any position). To do this, in search.php, look for the following code on line 94:

$where = implode(" AND ",$wheres);

...and REPLACE this with:

$where = "search_name LIKE '%".database_safe($parts[0])."%'";

Cheers,
David.

Submitted by Klyde on Fri, 2008-12-19 13:06

Thanks for your fast reply, unfortunately It don't change anything :(

Submitted by support on Fri, 2008-12-19 13:08

Hi,

Could you email me your search.php and i'll take a look...!

Cheers,
David.

Submitted by Klyde on Fri, 2008-12-19 13:17

Email sent

Submitted by support on Fri, 2008-12-19 13:47

Hi Klyde,

Nothing received - can you check the address. I'll also send you an email...

Cheers,
David.

Submitted by Klyde on Fri, 2008-12-19 18:23

The file you send me give 0 result with the search "Nea" :-(

Submitted by support on Fri, 2008-12-19 18:42

Hi,

Sorry - I had used the wrong character in the wildcard expression in the SQL. I've sent you another version which should do the trick...!

Cheers,
David.

Submitted by Klyde on Fri, 2008-12-19 19:21

With this on results are ranked in the same order as the original version.

Submitted by support on Fri, 2008-12-19 19:26

Hi,

Thanks for the feedback; i'll look into this more for you...

Cheers,
David.

Submitted by Klyde on Mon, 2009-01-26 16:28

Any new idea?

Submitted by support on Mon, 2009-01-26 16:37

Hi Klyde,

This will probably require some hard coding to handle the specific cases as there will always be situations that exceed the search and indexing capabilities of MySQL.

Could you perhaps email me your latest search.php and a couple of example queries that do not show the products you want to be returned, together with the products that you would like to see in those results...

Cheers,
David.