module:search can not search Chinese/Japanese/Korean Characters.

fishfree2

Joined: 2011-12-15
Posts: 2
Posted: Thu, 2011-12-15 08:32

There is a bug in the search module: can not search Chinese/Japanese/Korean Characters.
How can I edit the source code to solve this problem?

 
andy duggan

Joined: 2006-05-21
Posts: 84
Posted: Thu, 2011-12-15 10:48

I Confirm this .... it wont even pull up Japanese/Chinese tags. Nothing at all from album names or tags.

 
twu2

Joined: 2005-10-12
Posts: 7
Posted: Mon, 2011-12-19 02:51

G3 use MySQL's full-text search feature to do the search, it's not work in CJK....
you can modify it to use like to do the search, but it might affect the performance if you have BIG table size for search_records table.

the attach patch will use like to do search if there's non-english word in the search string.

AttachmentSize
gallery3_search_CJK.zip961 bytes
 
fishfree2

Joined: 2011-12-15
Posts: 2
Posted: Mon, 2011-12-19 01:47

Thank twu2 for your soon reply. It works now.

 
andy duggan

Joined: 2006-05-21
Posts: 84
Posted: Sun, 2012-06-03 13:26

How do you apply the patch? ... how to run it? Or is it a manual edit?

 
inposure
inposure's picture

Joined: 2010-04-23
Posts: 304
Posted: Sun, 2012-06-03 20:19

It works just fine, if you make your server fully UTF-8 compliant (older MySQL usually defaults to Latin-1, being a silly Swedish company).

http://dev.mysql.com/doc/refman/5.1/en/faqs-cjk.html

 
andy duggan

Joined: 2006-05-21
Posts: 84
Posted: Wed, 2012-06-13 03:30

Not it doesnt... mine are already utf-8.

 
andy duggan

Joined: 2006-05-21
Posts: 84
Posted: Wed, 2012-06-13 03:31

Using gallery 3.0.3

Odd behaviour with the search and chinese/Japanese kanji characters.

It does not return any results when a full name is used, and also part name using one or more characters.

At first it seemed to return results if the first character of a name was used but for some search phrases it wasnt working either.

Examples
Hiragana 'alphabet'
Search: スノーシュー
translates to;snowshoe
returns results

All part word searches return results
Search: ス
returns all results
This is used in the popular tags mostly and only in 1 album title.

The traditional kanji characters don't work as well.

Search: 山急山
Returns nothing but there is an album with it in the name.

Search: 山急
returns nothing.Same for 2 characters.

Search: 山
This is the character for mountain and is in many tags/album titles and descriptions - returns nothing.

Search: 妙義山
In at least 3 album titles and descriptions but returns nothing.

Search: 妙義
returns 1 album

Search: 妙
returns 1 album

These are also popular tags but the search doesn't pick them up.

You can try it yourself copying and pasting tags or parts of album names.
http://outdoorclubtokyo.com/gallery/