## Full-Text Search

The JavaHelp system full-text search engine uses a natural language search technology that not only retrieves documents, but locates specific passages within those documents where answers to queries are likely to be found. The technology involves a conceptual indexing engine that analyzes documents to produce an index of their content and a query engine that uses this index to find relevant passages in the material.

As the help author, you create the search database that is searched by the JavaHelp system full-text search engine. The process of creating the search database is described in Creating the Full-Text Search Database.

### How Searching Works

To initiate a search the user enters a natural language query in the search navigator Find text box. The results are reported back to the user in the following display:

- The circle in the first column indicates the ranking of the matches for that topic. The more filled-in the circle is, the higher the ranking. There are five possible rankings (from highest to lowest):
- The number in the second column indicates the number of times the query was matched in the listed topic.
- The text specifies the name of the topic (as specified in the topic's `<TITLE>` tag) in which matches are found.

  | To avoid confusion, ensure that the `<TITLE>` tag corresponds to the title used in the table of contents.

#### Relaxation Ranking

The search engine uses a technique called relaxation ranking to identify and score specific passages of text that are likely to answer the user's query. The relaxation ranking algorithm compares the user's query terms with occurrences of the same or related terms in the help topics. The search engine attempts to find passages in the help topics in which as many as possible of the query terms occur in the same form and the same order. The search engine automatically relaxes these constraints to identify passages in which:

- Not all of the terms occur
- The terms occur in different forms
- The terms occur in a different order
- The terms occur with intervening words

The search engine assigns appropriate penalties (that lower the ranking) to the passages for these deviations from the specified query.

| The ranking process improves as queries become more complex and include more information.

#### Morphing

The JavaHelp search engine uses "morphing" technology to find words with common roots. For example, when the term "build" is included in a search string, matches that contain "built", "builder", "building", and "builds" are returned.

See also:

  Creating the Full-Text Search Database
  The `jhindexer` Command
  The `jhsearch` Command
  Localizing the Full-Text Search Database