Customizing Search Applets

 

Specifying Search Applet Parameters

QuestAgent provides a high degree of applet customization that is obtained by supplying parameters in either qagent.prm file or HTML file as part of the APPLET tag.

Using parameters from the qagent.prm file (or some other file you name) provides greater level of flexibility and easier reuse of settings among different search pages.

Parameters in qagent.prm are specified in format:

# Comment
param_name=parameter value

To specify the same parameter directly in your HTML page, add the following line between the opening <applet> tag and the closing </applet> tag:

<param name="param_name" value="parameter value">

Basic Parameters

Name
(names are not case sensitive)

Value Description

IndexFile

IndexFile<num>

A required parameter.
Name of the index file. This parameter consists of a file name defined by the OutputFileName parameter and path relative to the applet’s codebase.

To avoid security exceptions with some browsers, you should copy index files to a directory below the applet’s codebase.

IndexDescription<num> Description of the specified index.
Prefix<num> Path to documentation root. This path should be relative to QuestAgent deployment directory.

Target

Frame name for displaying document results.
Default is the current frame.

Clock

Set to "on" to print searching statistics to Java console. Defaults to Off. Useful for debugging.

DisplayMode

Sets internal panel or external panel mode for the search applet.

Set to "external" to display a button instead of the search panel. The user clicks the button to open an external search panel. See "Launch Button Template" and "Using External Search Panel."

Tip: Use the applet_geom parameter to set the size of external search panel.

Layout

Sets the component layout configuration.
Supported values: 0, 1 and 2. Value 0 enables absolute component positioning and sizing. Values 1 and 2 adjust component sizes to the applet’s size.

Layouts 1 and 2 are defined as follows:

Layout 0 can be used with SearchApplet.class only. However, this it's not recommended due to incompatibilities with some browsers. It has been provided for compatibility with previous releases of the QuestAgent.

AutoLaunch

Set to "yes" to provide an external window is shown right after HTML page with the applet is loaded.

Result_Format

A string that sets the format for presenting search results. See result display format.

Message Customization

You can set search applet message string using message parameters. The following table shows QuestAgent applet message parameter names and default messages.

Parameter name Description Default message value
msg.wait
The message that occurs when a search has started but results have not yet returned. Searching...
msg.stopped
The message that occurs when a user stop the search. Search has been stopped.
msg.no_matches
The search found no results. No matches.
msg.hit_count
The text accompanying the number of items returned from the search. Number of hits:
msg.error
The text preceding an error message. Error occurred.
msg.bad_query
The query submitted to the QuestAgent search applet was not properly constructed, i.e. syntax error. Bad query.

Result Display Format (SearchApplet.class only)

When displaying query results, the SearchApplet uses a default result format consisting of the hit number followed by the document title. The format can be changed using the result_format applet parameter.

For example, if you insert the following parameter line into your search page the search applet displays hits in the DocumentTitle (FileLength) format:

result_format=%D (%L)

Format directives are:

Directive Display Format Item
%N
Hit Number
%D
Document Title
%L
File Length
%R
Hit Relevance in %
%W
Hit Relevance (weight) as a numerical value

Using External Search Panel

When DisplayMode parameter is set to external the following parameters can be used to customize start button appearance and size of the external search window:

geom.frame

Can be used to define window size and title. For example:

geom.frame.width=350 
geom.frame.height=300
geom.frame.label=Search My Documents

geom.launch_button

Define appearance of the launch button that will appear in HTML page. For example:

geom.launch_button.bgcolor=blue

geom.launch_button.image

Define an image to be used for launch button. For example:

geom.launch_button.image=image.gif

See "Component Geometry Parameters" for all available geometry options.

Query Handling Customization

Query handling parameters change the way of query interpretation. The following parameters have been supported:

collection<num>.query.AndWord 

Defines AND term used in advanced queries. Default value is "and".

collection<num>.query.OrWord

Defines OR term used in advanced queries. Default value is "or".

collection<num>.query.NotWord

Defines NOT term used in advanced queries. Default value is "not".

collection<num>.query.IgnoreTrailingDot

Defines whether trailing dot of the term should be ignored. Default value is "true". This option is used for appropriate handling of abbreviations.

For example, if this option is enabled, search for "N.Y." is equivalent to "N.Y".

collection<num>.query.AllowSpacesInWord

If this option is enabled space characters will be treated as part of the query word. This option is disabled (false) by default.

collection<num>.query.AllowParenthesis

If this option is disabled parenthesis will be treated as part of the query word. Otherwise, parenthesis will be used to form nested expressions in complex queries. This option is enabled (true) by default.

collection<num>.query.AllowFieldPatching

QuestAgent allows use of field names in queries, where field name and query word are coupled by '=' sign (query "name=john and position=salesman" for example.)

This option is enabled (true) by default. If this option is disabled, sign '=' will be treated as part of the query word.

collection<num>.query.MemSavingsStartLevel

Internally, QuestAgent provides two different search methods. The first of them is very fast but requires more memory. The second search method can be much slower than the first one, but provides significant memory savings and allows use of QuestAgent with index databases which contain 100,000 (or even more) documents.

Default value is 5000, which means that memory graceful search method will be used if specified index database contains more than 5000 documents.

 collection<num>.query.SortBy

By default, all found documents will be sorted by its relevance. Specify this option if you want to sort items by some other criteria (title or file location for example.) List of found documents will still contain the same items (most relevant ones) but in different order.

Note: Query handling parameters don't have any effects on index database creation.

 

 

 


Copyright © 1997, 1999 JObjects - All right reserved.
contact@jobjects.com