• 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
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

SQL and JForum's Search

 
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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]
 
It wasn't my idea to go to some crazy nightclub in the middle of nowhere. I just wanted to stay home and cuddle with this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic