aspose file tools*
The moose likes JForum and the fly likes Searching chinese is actually working Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Products » JForum
Bookmark "Searching chinese is actually working" Watch "Searching chinese is actually working" New topic
Author

Searching chinese is actually working

Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
A few topics in the forum talked about the chinese search problem, and a simple test on my local installation showed i had the same problem. So I decided to tackle this problem. Surprisingly it turns out it's supported already!!!

My environment:
Windows XP SP2
Postgres 8.1 on local machine, UTF-8 DB creation

There're two word matching modes in jforum,"equal" and "like", "equal" means you search for a word, while "like" search for a series of characters. When generating SQL, "equals" -> = while "like"-> like

So, the cause is quite clear, you need to change the mode to "like" since default is "equal", simply add the following line to jforum-custom.conf. Or change in SystemGlobals.properties.

search.word.matching = like

In fact, if you don't change the mode, search for partial english word also doesn't return anything.

Roy

[originally posted on jforum.net by luorihui]
Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
oops, forgot to mention JForum version, it's JForum 2.1.6

Roy
[originally posted on jforum.net by luorihui]
Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
That's right.

The point of "equal" being the default value is that "like" performs worst, so I leave it to the board admin.

Rafael
[originally posted on jforum.net by Rafael Steil]
Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
This search trick is working excellent

Today, I just installed the 2.1.6 on a tomcat 5.5 with 5.0 mysql, chinese works.

remember to
1. CREATE DATABASE jforum CHARACTER SET utf8;
2. database.connection.string=jdbc\:mysql\://${database.connection.host}\:${database.connection.port}/${database.connection.dbname}?user\=${database.connection.username}&password\=${database.connection.password}&autoReconnect\=true&useUnicode\=true&characterEncoding\=utf8&useNewIO\=false&zeroDateTimeBehavior\=convertToNull&useServerPrepStmts\=false

in jforum-custom.conf file (remember, dont edit in mysql.properties file only, the running instance only read jforum-custom.conf based on the log output from the application that I read)

if it doesnt work, do #3
3. URIEncoding="UTF-8" useBodyEncodingForURI="true" in tomcat\conf\server.xml

Good luck to everyone who have problem with jforum in chinese. Now it is the time to try LDAP.
[originally posted on jforum.net by Matthew.Kwong]
 
jQuery in Action, 2nd edition
 
subject: Searching chinese is actually working
 
Similar Threads
different search problem in version 2.1.8 with 2.1.7
JForum2.1.4 bug
Culprit for non-ascii (chinese, japanese) search problem
can not understand a word
Search doesn't work on Chinese keywords