2007-01-09

Having Full-Text Search Working Properly on JavaHelp

Today I'm posting about technology.

This is a problem that I had to solve at work today. We are using JavaHelp for our On-Line help. Like many other have found issues with the Full Text Search so have we. What's the issue? Well, the selection on the help page is of by a few characters and continuously increases until the end of the page. Near the end of the page the selection of the searched word is completely off (see the issue on the Bug Database, a.k.a. Bug Parade).

This issue doesn't happen with JavaHelp 2.0.4 (fetch it from this page - here is the direct link). But for those of you that can't use it just yet, because of the wonderful tool you are using, there is a simple workaround:
  1. Unpack the HelpSet in trouble to a new folder. For instance, if the HelpSet is named help.jar extract it to the folder help);
  2. In that folder there will be a XXX_JavaHelpSearch folder that contains the full text search index. Delete that folder. In our example it will be called help_JavaHelpSearch, very intuitive...
  3. Standing in the extract folder (help in our example), run the jhindexer of the new JavaHelp on all html documents. For instance, if all documents are in the folder docs you just run "jhindexer docs/*.html".
  4. The jhindexer tool creates a JavaHelpSearch folder. Rename it to whatever you found in step 2. For instance, rename it to help_JavaHelpSearch.
  5. Add all the files to a new JAR file without any additional directories. You can do this by standing in the extract folder (help in the example provided) and issuing "jar cfv ../newjar.jar *". After this you have a new HelpSet in the newjar.jar file in which the Full Text Search selects the text properly.
And that is it for the first programming related entry of this blog. Any issue, send a comment.

No comments:

Post a Comment