Jump to content
enkelhandel

Quick Search block not working with other languages?

Recommended Posts

I got product 'Lorem ipsum' (same on all languages, as default) and the module Quick search block finds it when the storefront is set to english but not when set to e.g. Swedish. (see attachments)

 

Am I doing something wrong?

post-89093-0-04282600-1343250247_thumb.png

post-89093-0-59590300-1343250252_thumb.png

Edited by enkelhandel (see edit history)

Share this post


Link to post
Share on other sites

I've been looking more into it. Found the table ps_search_word and only english is indexed even though Swedish is the default language.

If this is a bug it is a big one.

Share this post


Link to post
Share on other sites

Since I need to search in Thai which is a non-Latin language, I workaround by changing my_shop\classes\Search.php,

llok for define('PREG_CLASS_SEARCH_EXCLUDE', ------------->> around line 31

 

remove

\x{e31}\x{e34}-\x{e3f}\x{e46}-\x{e4f}

 

So that these characters are not excluded (these are Thai vowels).

 

It works for me. Keep in mind that you may have to include different characters than mine.

 

I have not done extensive test, so don't know whether it also work for other languages. I believe that there must be more elegant way of doing this, I am appreciate if someone would enlighten me.

Edited by Suthichai (see edit history)

Share this post


Link to post
Share on other sites

same issue here. I have English and Chinese. Search is not working at all when I switched to Chinese interface, not even working for searching English words.

 

another question, does the search require at least 3 characters to work?

Share this post


Link to post
Share on other sites

Anyone working on this issue? It is a real big problem, would be nice to have some update, is it solved in 1.5.0.15?

Share this post


Link to post
Share on other sites

In my case (Thai language), I have to remove from classes/Search.php, around line 41-42

\x{e31}\x{e34}-\x{e3f}\x{e46}-\x{e4f}

Reference http://en.wikipedia.org/wiki/List_of_Unicode_characters#Thai

I make sure that U+0E01 to U+0E59 are not excluded. I think other non-latin language may be similar, and don't forget to rebuild the index (Preferences > Search > Rebuild Entire Index)

Share this post


Link to post
Share on other sites

hello @Suthichai

if you are able, can you please let me know which charaters to remove from the define('PREG_CLASS_SEARCH_EXCLUDE', for cyrillic letters? i tried to find the according codes via wikipedia, but with no success. (i did rebuild the index, tho). using presta 1.5.3.1

 

thanks in advance!

Share this post


Link to post
Share on other sites

igor.i, As far as I can see, Cyrillic is in the range of U+0400 and U+04FF, and I guess there isn't any that can be excluded in PREG_CLASS_SEARCH_EXCLUDE, except x{482}-\x{489} (which are Thousands Sign and Millions Sign) and it should be excluded any way. So I think (I maybe wrong) nothing can be done here.

 

But I think the $PS_ALLOW_ACCENTED_CHARS_URL may be the cause, try to add the missing record to your database, it might help.

 

See this post for the related issue

http://www.prestasho...l-friendly-url/

 

Add missing field

INSERT INTO `ps_configuration` (`id_shop_group`, `id_shop`, `name`, `value`, `date_add`, `date_upd`)
VALUES  (NULL, NULL, 'PS_ALLOW_ACCENTED_CHARS_URL', '1', '2013-01-02 00:00:00', '2013-01-02 00:00:00');

Share this post


Link to post
Share on other sites

Since I need to search in Thai which is a non-Latin language, I workaround by changing my_shop\classes\Search.php,

llok for define('PREG_CLASS_SEARCH_EXCLUDE', ------------->> around line 31

 

remove

\x{e31}\x{e34}-\x{e3f}\x{e46}-\x{e4f}
So that these characters are not excluded (these are Thai vowels).

 

It works for me. Keep in mind that you may have to include different characters than mine.

 

I have not done extensive test, so don't know whether it also work for other languages. I believe that there must be more elegant way of doing this, I am appreciate if someone would enlighten me.

 

Hi. suthichai

what prestashop version do u used ??

i am using 1.5.6.1.. Is it work for me ??

7zhop

Share this post


Link to post
Share on other sites

Thanks suthichai

 

Since I need to search in Thai which is a non-Latin language, I workaround by changing my_shop\classes\Search.php,
llok for define('PREG_CLASS_SEARCH_EXCLUDE', ------------->> around line 31

remove

\x{e31}\x{e34}-\x{e3f}\x{e46}-\x{e4f}          So that these characters are not excluded (these are Thai vowels).

It works for me. Keep in mind that you may have to include different characters than mine.

I have not done extensive test, so don't know whether it also work for other languages. I believe that there must be more elegant way of doing this, I am appreciate if someone would enlighten me.

 

i am using 1.5.6.1.. Is it work for me .
7zhop

Share this post


Link to post
Share on other sites

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More