#### 20.5.2 Creating a search index for JavaHelp

JavaHelp utility program JHIndexer creates a search index for JavaHelp, and places the search index in a subdirectory called JavaHelpSearch. You can have DITA2Go run JHIndexer, or you can run it yourself. In addition to creating a search index, you must also provide a link to the search index from the helpset file; see §20.5.1 Including a search-index link in the helpset file.

Let DITA2Go create FTS

To have DITA2Go automatically run JHIndexer:

    [JavaHelpOptions]
    ; FTSCommand = for Sun Java Help, path to jhindexer, such as:
    FTSCommand = D:/jh2.0_01/jh2.0/javahelp/bin/jhindexer

The value of FTSCommand must include an absolute path to the directory where the JHIndexer program is installed on your system. If the path includes spaces, you must enclose it in double quotes. For example:

    [JavaHelpOptions]
    FTSCommand = "G:/JH/jh2.0 01/jh2 0/javahelp/bin/jhindexer"

Do not enclose parameters in quotes:

- Use backslashes as separators in path-name parameters.
- Use a dash (“-”) instead of a forward slash to prefix a command option.

When you specify a value for FTSCommand, after generating output files for JavaHelp, DITA2Go first removes any search-index directory previously created by JHIndexer, then uses the command to run JHIndexer and produce a new search index.

If you also specify a value for [Automation]WrapPath, DITA2Go copies all needed files from the project directory to the JavaHelp directory structure before running JHIndexer; see §20.3.6.2 Letting DITA2Go set up the directory structure and copy files.

Create FTS yourself

If you do not specify a value for FTSCommand, you must run JHIndexer yourself, from the directory where your helpset file is located, and specify the directory where the HTML files are located. For example, at a Windows command prompt:

    D:
    cd \path\to\MyOutput\help
    del /f /q JavaHelpSearch
    path\to\JavaHelp\files\bin\jhindexer html

If you are using a directory structure such as the following for your project, run JHIndexer from the Help directory:

    MyDoc    (DITA files)
    ..MyOutput (DITA2Go files)
    ....Help    (JHM, HS, TOC, Index; run JHIndexer from this directory)
    ......HTML
    ......Graphics

Your structure ends up looking like this:

    MyDoc    (DITA files)
    ..MyOutput (DITA2Go files)
    ....Help    (JHM, HS, TOC, Index)
    ......JavaHelpSearch (Created by JHIndexer)
    ......HTML
    ......Graphics

JavaHelp search caveats

It is best to remove any previous search-index directory before you run JHIndexer to create a new directory. If a previous attempt to create a search index failed, further attempts will also fail if the failed search-index directory is present.

You must run JHIndexer from the directory where the helpset file is located. If you try to run JHIndexer from within the HTML directory, JHIndexer will put the JavaHelpSearch directory inside the HTML directory. If you try to run it from any other directory, you get strange effects in the Contents panel.

See also:

§16.2.2 Compiling and distributing Help systems

§20.3.6.2 Letting DITA2Go set up the directory structure and copy files

§20.3.6.4 Specifying a path for search-index links

§20.5.1 Including a search-index link in the helpset file

§44.10 Gathering and processing Help-system files

Previous Topic: 20.5.1 Including a search-index link in the helpset file

Next Topic: 20.5.3 Creating a search index for Oracle Help

Parent Topic: 20.5 Providing full-text search for JavaHelp / Oracle Help

Sibling Topics:

20.5.1 Including a search-index link in the helpset file

20.5.3 Creating a search index for Oracle Help

Table of Contents • Index