FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum » How To » how to search in chinese
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
how to search in chinese [message #159039] Mon, 27 April 2009 05:17 Go to next message
linchenxu is currently offline  linchenxu
Messages: 6
Registered: April 2009
Karma: 0
Junior Member
Language on my forum is Chinese.
There is no blank between Chinese words.
If I want to search in Chiense,I must all match the sentence.
I cannot search by some key words.
How to modify the search function?

and where are the topic data saved?
I cannot fine them in the database.

thanks.
Re: how to search in chinese [message #159040 is a reply to message #159039] Mon, 27 April 2009 06:11 Go to previous messageGo to next message
naudefj is currently offline  naudefj   South Africa
Messages: 3772
Registered: December 2004
Karma: 28
Senior Member
Administrator
Core Developer
This shouldn't happen with FUDforum version 2.8.1RC1. What version are you using?
Re: how to search in chinese [message #159044 is a reply to message #159040] Mon, 27 April 2009 14:45 Go to previous messageGo to next message
linchenxu is currently offline  linchenxu
Messages: 6
Registered: April 2009
Karma: 0
Junior Member
MY using version is version 2.8.1RC1
for example:
i have a topic named "测试搜索"
if i want to search this topic,i must search all the words "测试搜索".
It cannot be searched by "搜索"or"测试"
index.php?t=getfile&id=5575&private=0
  • Attachment: 1.jpg
    (Size: 31.07KB, Downloaded 1506 times)
Re: how to search in chinese [message #159045 is a reply to message #159040] Mon, 27 April 2009 14:46 Go to previous messageGo to next message
linchenxu is currently offline  linchenxu
Messages: 6
Registered: April 2009
Karma: 0
Junior Member
index.php?t=getfile&id=5576&private=0
  • Attachment: 2.jpg
    (Size: 39.79KB, Downloaded 1497 times)
Re: how to search in chinese [message #159046 is a reply to message #159045] Mon, 27 April 2009 19:36 Go to previous messageGo to next message
naudefj is currently offline  naudefj   South Africa
Messages: 3772
Registered: December 2004
Karma: 28
Senior Member
Administrator
Core Developer
OK, I understand the problem. However, I have no idea ho to fix it. The code is in isearch.inc.t if you want to have a look at it:

// Match utf-8 words (remove the \p{N} if you don't want to index words with numbers)
preg_match_all("/\p{L}[\p{L}\p{N}\p{Mn}\p{Pd}'\x{2019}]*/u", $text, $t1);


If you find a solution, please let us know as well.

Best of luck!

Frank
Re: how to search in chinese [message #159049 is a reply to message #159046] Tue, 28 April 2009 14:47 Go to previous messageGo to next message
linchenxu is currently offline  linchenxu
Messages: 6
Registered: April 2009
Karma: 0
Junior Member
very thanks for your help.
by the way,i have another bug i don't sure to report.
it just happens with chinese langage.
Chinese words take two bytes,and English letters and punctuations take one byte.
When they are mixed to be used,some chines words become some wrong letters or "?" sometimes.
if i change the form of English letters and punctuation to be take two bytes,that will display normally.
for example,i typed the same sentence with different forms of English letters.

index.php?t=getfile&id=5578&private=0

i am very sorry to trouble you all the time.
THanks.
  • Attachment: error1.jpg
    (Size: 96.89KB, Downloaded 1493 times)
Re: how to search in chinese [message #159068 is a reply to message #159049] Sat, 02 May 2009 09:23 Go to previous message
naudefj is currently offline  naudefj   South Africa
Messages: 3772
Registered: December 2004
Karma: 28
Senior Member
Administrator
Core Developer
This sounds more like a browser or database problem. Please check if the data in the database is OK.

Also, please apply this patch to see if it solves your searching problem:

Index: isearch.inc.t
===================================================================
RCS file: /forum21/install/forum_data/src/isearch.inc.t,v
retrieving revision 1.71
diff -u -r1.71 isearch.inc.t
--- isearch.inc.t       29 Apr 2009 20:34:12 -0000      1.71
+++ isearch.inc.t       2 May 2009 09:19:07 -0000
@@ -17,7 +17,7 @@
        // Match utf-8 words (remove the \p{N} if you don't want to index wordswith numbers)
        preg_match_all("/\p{L}[\p{L}\p{N}\p{Mn}\p{Pd}'\x{2019}]*/u", $text, $t1);
        foreach ($t1[0] as $v) {
-               if (isset($v[51]) || !isset($v[2])) continue;   // word too long or too short
+               // if (isset($v[51]) || !isset($v[2])) continue;   // word too long or too short
                $a[] = _esc($v);
        }


Remember to rebuild your search index after applying the patch.

Best regards.

Frank
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: When importing forum data...
Next Topic: Troubleshooting admin MySQL connection problem
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Wed Dec 18 05:36:02 GMT 2024

Total time taken to generate the page: 0.02591 seconds