File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JForum and the fly likes SQL and JForum's Search Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JForum
Bookmark "SQL and JForum Watch "SQL and JForum New topic
Author

SQL and JForum's Search

Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
I created SQL script which manually populates jforum_topics, jforum_posts, jforum_posts_text with some test messages.

JForum displays all these messages without any problems. However, search does not work. Could someone outline which jforum's tables need to be populated together with above 3 table in order for search to work ?

Greetings from BE

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

Joined: Apr 22, 2012
Posts: 17424
jforum_search_words, jforum_search_wordmatch

If you want, you can use a tool to index the messages for you. Take a look at

https://jforum-tools.dev.java.net/source/browse/jforum-tools/searchIndexer/src/net/jforum/tools/searchIndexer/SearchIndexer.java?rev=1.1&view=auto&content-type=text/vnd.viewcvs-markup

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

Joined: Apr 22, 2012
Posts: 17424
Thanks Rafael !

That's exactly what I was looking for !!!

Btw, SQL expressions in the source code are for MySQL and because HSQLDB does not support Statement.RETURN_GENERATED_KEYS and words.getGeneratedKeys(). So, I needed to modify SQLs in order to get it work. Anyhow, I did it and it works OK. (even German Umlauts and French letters are searchable.

Attached is the modified source code. It must be MUCH MUCH slower then original because it uses max(..) SQL function instead getGeneratedKeys. But that's life. Anyhow, someone may find it useful

One more question: it seems that the search does not support wildcards *%? (i.e. search for TES* will not return TEST and TESTS). If yes, then it is a big big limitation

Greetings from BE
[originally posted on jforum.net by teolein]
Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
teolein wrote:
One more question: it seems that the search does not support wildcards *%? (i.e. search for TES* will not return TEST and TESTS). If yes, then it is a big big limitation

Greetings from BE


Not exactly. In the first versions it was made with the LIKE syntax, but when you get to some high load, like 2 milion data in the search tables, it turns very slow, so that's why I moved to simple equalitiy.

Once I promissed someone to make it configurable, but I didn't do that so far ;)

Rafael
[originally posted on jforum.net by Rafael Steil]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: SQL and JForum's Search
 
Similar Threads
BB Text Selection/Marks Problems
API for external application
TCP/IP SOCKETS T4Agent.sendRequest() OutputStream.flush() Broken pipe * 0
Interface Direction>>>Plz help
prepared statements in hibernate