Jump to content

Quick Search block not working with other languages?


Recommended Posts

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)
Link to comment
Share on other sites

  • 3 weeks later...

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?

Link to comment
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)

Link to comment
Share on other sites

  • 4 months later...

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!

Link to comment
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');

Link to comment
Share on other sites

  • 3 months later...
  • 1 year later...

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

Link to comment
Share on other sites

  • 2 weeks later...

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

Link to comment
Share on other sites

  • 11 months later...
×
×
  • Create New...