You are here:  » Special Characters in search

Support Forum



Special Characters in search

Submitted by Kelly and Stuart on Wed, 2008-06-25 16:43 in

Hi David

I have a feed for Ikea and the product names have squiggly å etc. They display nicely in the titles, but when typed normally are not found in the search. E.g. One range is the TRÄBY shelf range. Joe public may type in traby (without squiggly) in the searchbox, but no products are found. Is there a way that the search can see special characters as normal ones, or should I just strip them out?
Kelly

Submitted by support on Wed, 2008-06-25 18:52

Hi Kelly,

Perhaps the best way to handle this is in exactly the same way as I have just suggested in another thread regarding mis-spellings. If the ranges that use special characters are manageble, you could use the modification described here:

http://www.pricetapestry.com/node/2111

...using lines such as:

  if (strtolower($word)=="traby") $parts[0] .= " TRÄBY ";

(case doesn't matter in the added word)

Stripping them out is of course an option, as is search and replace on the product names (search "å", replace "a") if you are expecting most users to use the normal character instead of the accented version...

Cheers,
David.

Submitted by Kelly and Stuart on Wed, 2008-06-25 23:18

Hi David
I haven't been able to get this to work, but not to worry as I'll strip them out for know. I'll keep an eye on analytics to see if people are using the accents and if so I'll reopen the post.

On another note:

featured products - I use the random featured products page on my index page and would like to keep that as is, but also I would like on a currently static page, approx 12 random featured products from a set merchant where the price is over £300. Is this possible to do and if so how?

Many thanks for your time
Kelly

Submitted by support on Thu, 2008-06-26 07:02

Hi Kelly,

Basically, all you need to do is copy the featured products code from index.php and use it in your static page (i'm assuming that your static page can still execute PHP?). The featured products code is actually the majority of index.php, beginning with:

  $sql = "SELECT * FROM `".$config_databaseTablePrefix."featured` ORDER BY sequence";

...all the way down to:

  if (isset($featured)) require("html/featured.php");

To use random products from a particular merchant where the price is over £300 simply change the first line to:

  $sql = "SELECT *,1 AS sequence FROM `".$config_databaseTablePrefix."products` WHERE merchant='Some Merchant' AND price > '300.00' ORDER BY RAND() LIMIT 12";

...modifying 'Some Merchant', '300.00' and 12 as required...

Hope this helps!

Cheers,
David.

Submitted by Kelly and Stuart on Thu, 2008-06-26 21:43

Just what I was after.
Many many thanks - once again
Kelly

Submitted by bjbtexas on Wed, 2008-09-03 14:46

How do I get rid of � characters that are coming up in my search as product not found.

I tried $text = preg_replace('�','',$text);

..but I can't write code, so it was a stab in the dark...

Submitted by support on Wed, 2008-09-03 14:50

Hi,

Where is this text (which sounds like it is not in the same character set as your site) appearing? Can you post (or email if you like) a link to an example...

Cheers,
David.

Submitted by bjbtexas on Wed, 2008-09-03 15:07

Here is the link where it is appearing:

{link saved}

Submitted by support on Wed, 2008-09-03 15:10

Thanks - i've followed up by email...

Cheers,
David.

Submitted by Milano on Mon, 2010-02-15 11:38

Hi,
I have similar problem. My site and xml/csv's are in uft-8 coding but I have problem with products name witch contain some polish letters like: ó, ł, ż... Example, when I search "ława Alex" (en: Alex table) script is finding this products, but when I search "ława", no products are founded :(

Could you tell me how to fix it?

ps. sorry for my broken english ;)

Submitted by support on Mon, 2010-02-15 11:44

Hi Milano,

Could you email me a link to your site and I will have a look for you...

Cheers,
David.