Win a copy of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Search doesn't work on Chinese keywords

 
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear Rafael,
I got JForum 2.0.2 up and running on my Tomcat 5.5.4+JDK1.5.0+PostgreSQL 7.4/RedHat Linux 9 box. I use UTF-8 encoing. The Chinese input is fine. But I can't search back the post. Is there anything wrong about the search? There is always 0 result.

BTW. I got a JavaScript warning on the search.htm page. I think it's better to add a name="formSearch" at the end of the <form> tag
[originally posted on jforum.net by andowson]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I find a way to fix this problem. Just modify the insertSearchWords() method in net/jforum/drivers/generic/SearchModel.java. Find the following code fragment.

change it into the following:

It will generate every word length longer than 1 into a keyword.

BTW. There is a little bug on searching capital word. JForum generates keyword in lowercase, for example, ok. However, if you input a keyword in uppercase, for example, OK. You won't get any result. To fix this bug, just modify the topicsByKeyword() method in this file again. Find the following code fragment.

Change it into the following:

recompile it and put the generate SearchModel.class to replace the original one.
[originally posted on jforum.net by andowson]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For large forums it could be useful to integrate a text search engine like lucene.


http://jakarta.apache.org/lucene/docs/index.html
[originally posted on jforum.net by marc]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
OK, I changed the code as you said.

However, inserting every word can make the index a little messy, as well I removed the 'LIKE' sintax since it does not perform well on large forums.

Probably I'll put some configuration option to these issues.. something like "search.index.all.words" and "seach.use.like".

Rafael
[originally posted on jforum.net by Rafael Steil]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Lucene is in mind for a long time, but integration is not that easy. Implementations are welcome.

Rafael
[originally posted on jforum.net by Rafael Steil]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, lucene is a waiting feature. I see mvnForum hava use it. But they need to set URLEncoding=UTF-8 in Tomcat 5's Connector setting for Chinese fix.
If you've developed it in JForum, I'll help to test it in Chinese environment.

Before Lucene is integrated, the search still needs to work. So, I use this every word is keyword strategy. The users will think this forum is useful when they really post an article and they can search it back later. If they can't search back, they will think this forum is wrong no matter you use what kind of search engine.

Andowson
[originally posted on jforum.net by Anonymous]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, I can add these config options I mentioned. It will be great if you could help with Chinese ( and therefore all cyrillic languages )!

Rafael
[originally posted on jforum.net by Rafael Steil]
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic