HTML Interface with Word Highlighting Customization
(HLSearchApplet.class)
The figure below shows default search form you get when you deploy "HTML Interface with Word Highlighting" QuestAgent layout template.
IMPORTANT: Always deploy HTML Interface to your document root (don't use suggested jobjects subdirectory). Otherwise, your documents will not be accessible to the QuestAgent applet.

Search requests and word highlighting are handled by QuestAgent applet and JavaScript methods. Both are hidden in zero-sized frame. See qaprg.htm file if you want to change some behavior.
QuestAgent applet recognizes the following query parameters:
| HTML Form Field | Description |
query |
Query text. Note: Using HTML Interface you can also search by more than one index field. Prepare your query using format described in "JavaScript Interface." |
maxhits |
Maximal number of documents to return. |
collection |
Document collection index. Use to select index database for your search. Default value is "1". |
show_highlighted |
Set this field to "on" or "yes" to enable word highlighting. May be hidden or used as a check box (see form.tpl). |
template.html.* |
Template parameters can be used in HTML form to request change
of presentation template in the runtime. See form.tpl for example. |
sortby |
Specify this option if you don't want to sort found documents by relevace but some data field (title or file location for example.) List of found documents will still contain the same items (most relevant ones) but in different order. |
Notice: To be able to use "Full description" option defined in default search form you need to store document description field in your index database. See "Using Description Area" for instructions.
QuestAgent applet creates search and result pages "on the fly" using predefined templates. When you deploy HTML Interface layout, default presentation templates will be created in htmlagnt subdirectory. All these templates are plain text files (we used tpl file name extension, but you can change it if you like.)
The following presentation templates are supported:
| Name | Description |
header |
Page header. |
form |
Search form. See form.tpl for example. |
bhits |
Content to show before hit list. |
hits |
Template used to print found items. You can display any record field using %field_name% format. See hits.tpl file for example. |
ahits |
Content to show after hit list. |
nohits |
Content that will be shown if nothing was found. |
footer |
Page footer. |
To specify template file define applet parameter:
template.html.<name>=MyTemplate.tpl
Notice that you can replace templates in the runtime specifying template.html.<name> form field. See form.tpl template file.
Runtime properties are used in presentation templates to insert data obtained from the QuestAgent applet to result HTML page. You can define your own properties using setQueryParameter method accessible from the JavaScript. All runtime properties begin with "rt.". You can take a look at form.tpl and qaprg.html for examples.
Runtime properties are used in format %property_name% and can appear anywhere in your template. For example:
<b>Documents: %rt.hit_count%</b><br>
The following table shows predefined runtime properties:
| Property Name | Description |
rt.previous_query |
Previous query. See form.tpl for example. |
rt.keywords |
Keywords used in query. Build in document link to enable
word highlighting. See hits.tpl for example. |
rt.hit_id |
Hit number. See hits.tpl for example. |
rt.hit_count |
Number of found documents. Available in "after hits"
section. See ahits.tpl for example. |
rt.collection<num>.selected |
Has value "selected" if collection <num> was selected. Convenient for use in OPTION tag. Appropriate HTML tags will be created in form.tpl when you deploy more than one index. |
Beside basic QuestAgent applet parameters for index defining and query handling customization, "HTML Interface with Word Highlighting" layout (HLSearchApplet.class) supports the following:
| Parameter Name | Description |
highlight.tag_before |
HTML tag to insert before keyword. Default value is: This value can be changed from the JavaScript using setHighlightingTags method. See qaprg.htm for example. |
highlight.tag_after |
HTML tag to insert after keyword. Default value is: This value can be changed from the JavaScript using setHighlightingTags method. See qaprg.htm for example. |
template.html.* |
Definitions of presentation templates. Default parameters are defined in qagent.prm file. |
launcher.form |
Defines HTML file that will be loaded after QuestAgent applet is initialized.Default value is qasrcl.htm, which will show search form. |
launcher.target_frame |
Defines target frame where file specified by parameter above should be shown. Default value is qaview. |