Java
Search Product Page
Java Search is a Java written search
engine and as such can be run on any client that has a Java virtual machine. It
works by a keyword definition file being created and then matches on words the
user entered. This can be better than a full text search as it lets the
administrator define certain criteria. Introduction
This Search Applet is freeware and can be used on any site. The
applet lets the user enter a number of words and then searches a structured
file for those words and then displays relevant titles in the lower choice box.
By selecting one of these and clicking the Goto Question button (this text can
be changed by passing the label as a parameter to the applet) the applet
automatically links the user to the required page.
Every part of text is now fully configurable meaning the engine
can be used or any language site.
Recent Updates
Version 3.3 - Fixed a problem where +word* does not always display
answer.
Version 3.2 - Fixed the problem where word* does not always show the
answer.
How to include the Search Engine on a site
- Download the
SearchEngine.class
file which is contained in a zip file
- Extract to a directory
- Put the following into the HTML page you
wish to contain the Applet
<p><applet code="SearchApplet.class"
align="baseline" width="450" height="120"
name="SearchApplet">
<param name="location"
value="http://www.savilltech.com/ntfaq/">
<param name="linkbutton" value="Goto Answer">
<param name="dataloc"
value="http://www.savilltech.com/ntfaq/data.txt">
<param name="panelname" value="answer">
<param name="helploc"
value="http://www.helplocation.com/help/help.html">
</applet></p>
The parameters are optional and are described in the features section, and if none are entered it will look for
data.txt in the same place as the applet and the button will say "Goto
Link".
- Create your database file which will be read
in by the applet, again this structure is defined in the features section.
- Save this file in the location as defined by
the parameter name "dataloc"
Help

Input your question in the query box and then click search. Do
not use a question mark.
From the list of answers select one and then click "goto
question"
- You can add a + to search words, to force
the answer to contain the word, e.g.
convert +fat to +ntfs
- Use a wildcard at end of word, e.g.
install serv*
- Use the scroll bar to select how many
answers to display
- Ability to pass applet the location where to
find the main location of files as parameter "location". The link
defined in the codewords area is then appended to it, e.g.
http://www.savilltech.com/ntfaq as a parameter named location, the code in the
html file would be
<param name="location"
value="http://www.savilltech.com/ntfaq/">
If the link then was sysconf.html#sysconf22 it
would link to
http:\\www.savilltech.com\ntfaq\sysconf.html#sysconf22.
If this parameter does not exist then the applet
will just use getDocumentBase() and look for files in the same area as the
page.
- Data is read in from file data.txt which is
searched for in the location of the HTML file that contains the applet
(getDocumentBase()). This can also be passed as the "dataloc"
parameter.
The format of the files should be plain text with the following format, the |
character is used to separate entries
<the link>|<the title to be displayed>|<codeword
1>|<codeword 2>|etc. (no | at end, only newline), e.g.
datastor.html#newprod|Exciting new Datastore
Product|datastore|new|product
- You can also pass the text to be displayed
on the "Goto Question" button, by passing parameter
"linkbutton", e.g.
<param name="linkbutton" value="Goto
Answer">
- You can pass the panel to be updated with
link if used in a frame page, by passing the parameter "panelname"
with the name of the target frame, e.g.
<param name="panelname" value="main">
- You can pass the link for the help button as
the "helploc" parameter, it must include the http:, e.g.
<param name="helploc"
value="http://www.temp.com/help/help.html">
- All buttons and text on the applet can now
be configured by passing certain parameters. Below is a table summarizing
these
| Parameter |
What is
sets |
| location |
The location
that the links in the data file are appended to, e.g.
http://www.ntfaq.com/ntfaq |
| dataloc |
Name of the
data file. If not specified will look for data.txt in the documentbase (where
the page resides) |
| linkbutton |
The text that
is displayed on the "Goto" button |
| searchbutton |
Text displayed
on the "Search" button |
| helpbutton |
Text displayed
on the "Help" button |
| displaytext |
Test displayed
next to the number of display, e.g. "Display xx" |
| foundtext |
Text displayed
next to the slider to specify how many items to return |
| enterquery |
The default
text shown in the query box |
| panelname |
Panel to
update if used in a frame |
| helploc |
Location of
the help file when "Help" button is clicked. |
Example
If your base site was http://www.yourdomain.com and all
documents/links were under this site, the base location for the applet would be
http://www.yourdomain.com/.
For this example, lets say there are only 3 pages to link to as
follows:
- http://www.yourdomain.com/info/history.html
- History of the company
- http://www.yourdomain.com/products.html -
Products of the company (diskfast)
- http://www.yourdomain.com/staff/savillj.html
- John Savill
The keywords for each of the 3 were as follows
- history introduction yourdomain
- products diskfast
- john savill
Your data file would be the following
info/history.html|History of the company|history|introduction|yourdomain
products.html|Products of the company|products|product|diskfast
staff/savillj.html|John Savill|john|savill
Assume
this file was stored in http://www.yourdomain.com/search/data.inf, and the HTML
file was in the same area, the code would be
<p><applet code="SearchApplet.class"
align="baseline" width="450" height="120"
name="SearchApplet">
<param name="location"
value="http://www.yourdomain.com/">
<param name="linkbutton" value="Goto Link">
<param name="dataloc"
value="http://www.yourdomain.com/search/data.inf">
</applet></p>
If you wanted to link to
different sites, you would set the location parameter as just
"http://" and in the data file the links you be in the format
www.savilltech.com/dir/file.html
An example of the Search Applet in action can be seen at
http://windowsnt.miningco.com/library/blntfaq.htm.
The database this uses is very large and hence may take a while to
load.
Contact Information
If you
wish to discuss licensing the search engine in a product and/or require an
custom changes (logo etc.) please mail sales@savilltech.com. A number of
companies are already using the search engine in commerical products with
custom written changes.
|