FindinSite-CD: Search engine for CD/DVD   .
Powered by FindinSite-MS
. Home | Examples | Starting | Set up | Advanced | Languages | Purchasing | Email .
. .
  Screen layout | Applet parameters | Indexes & Subsets | Search page HTML


findinsite-cd indexes and subsets

Index parameter format
Base URLs
Providing more than one Index
Indexes for different locales


FindinSite-CD is flexible in its use of indexes and subsets.

FindinSite-CD only ever searches one index at a time. However, you can provide more than one index and your CD user can switch between them. If you provide indexes for different locales, FindinSite-CD will choose the most appropriate index for your CD user's locale.

Alternatively, you can set up an index so that it has subsets. Your CD user can choose which of the subsets that they want to include in a search. This would let them narrow their search, and so produce fewer but more appropriate results.

How to do it

The search page generated by FindinSite-CD-Wizard has only one index and does not use subsets. FindinSite-CD-Wizard cannot be used to change your search page to get more than one index or subsets.

If you want to use more than one index or subsets, then you must alter your search page by hand. You can either do this using a plain text editor, or with an HTML editor. The examples on this page show the plain text HTML required. See the applet parameters page for general details of how to set parameters.

As will be seen later on, indexes and subsets are specified in applet parameters named index1, index2 etc. You may also need to write an index specification file, or specify a ShowSubsets parameter.

Search database file loading

By default the search database files are loaded from the applet "DocumentBase". In some specialised circumstances (such as when using HtmlExecutable) you may want to load these files from elsewhere. Put "CodeBase" in the IndexDbBase applet parameter to load the search database files from the applet "CodeBase".

Indexes, Search databases and Subset names

Before we continue, it is best to be clear about what is meant by the terms index, search database and subset.

User perspective

A user of your CD can only search one index at a time. If there is more than one index, then an "Indexes" button lets them switch between indexes.

An index consists of one or more subsets (developer: each subset is a search database). If more than one subset is available then the user can choose the subsets to include in the search by clicking on the "Subsets" button (developer: this button may be removed if desired).

Developer perspective

From the CD developer perspective, you will still use FindinSite-CD-Wizard or Findex to create a search database. The FindinSite-CD runtime can be set up to search more than one index. Each index consists of one or more search databases.

Standard configuration

The search page generated by FindinSite-CD-Wizard will have just one index. This index will only contain one search database. Therefore the user will not see the "Subsets" or "Indexes" buttons.

Index parameter format

You must set one or more FindinSite-CD indexN applet parameters. For example, give index1, index2 and index3 parameters if you want to use three indexes.

Each indexN parameter value should be in this format, with a comma separating each field:

The dbspec field specifies the search databases to include in each index.
The optional locale field specifies the locale for this index. See the Languages page for details of how to specify a language code (and optionally country code) for a locale.

When FindinSite-CD starts, it chooses the index whose locale best matches the user's locale.

In the simplest case - generated by FindinSite-CD-Wizard - only one index parameter is set, index1, and this only refers to one search database, called MySite in this case.

<PARAM NAME=index1 VALUE="MySite,en">
Note that the locale field is set to "en" for English, but this is effectively ignored because this index is used in all cases (because there is no alternative!)

Specifying dbspec

The dbspec field is used to specify which search databases make up an index. If there is more than one search database given in dbspec then each search database will appear as a subset - see below for details of this.

In the simplest case, dbspec consists of one or more sub-fields, with an @ separating each sub-field:

databaseURL is the search database URL. This is usually in the same directory as the search page, but can be elsewhere. The Java safety "sandbox" makes it impossible for FindinSite-CD to access a search database in a higher directory, eg "../MySite". However it is fine to use lower directories, eg "french/MySiteFr" - note the use of forward slash / to separate the directory names.

baseurl is the optional Base URL for this search database. See the box below for more information.
A Base URL should usually end with a / character.

See below for information about selected.

Base URLs
A Base URL is the text that put in the front of a filename. For example, suppose FindinSite-CD-Wizard puts a page called index.htm in the search database. If the Base URL is, then the page that FindinSite-CD displays is

In most cases you do not need to specify a Base URL. If you do need a Base URL, then a relative URL is usually all you need. Only use BaseURLs if you need to display the file from a different location.

You can specify Base URLs in more than one place:

  • You can set one or more Base URLs for a search database in FindinSite-CD-Wizard.
  • In the baseurl sub-field of an indexN parameter.

In this example, two indexes are set. The first index (English in search database endb) has no Base URL. However, the second index (French, frdb) has a Base URL of french/, indicating the directory that contains all the French files on the CD.

<PARAM NAME=index1 VALUE="endb,en">
<PARAM NAME=index2 VALUE="[email protected]/,fr">
A Base URL should usually end with a / character.

Providing more than one Index

You can provide more than one index for your CD user to search. However only one index can be searched at a time. Searching multiple indexes is done using subsets - see below.

If you set more than one index then an "Indexes" button appears in the FindinSite-CD window. Clicking on the "Indexes" button shows a list of the available indexes. Click on the desired index to switch to the index.

Simply set as many indexN parameters as you want, eg:

<PARAM NAME=index1 VALUE="product1,en">
<PARAM NAME=index2 VALUE="product2,en">
<PARAM NAME=index3 VALUE="product3,en">

In practice it is quite likely that you will want to give a baseurl sub-field for some or all of the parameters, eg:

<PARAM NAME=index1 VALUE="Main,en">
<PARAM NAME=index2 VALUE="[email protected]/,en">
<PARAM NAME=index3 VALUE="[email protected]/,en">

In this example, files for search database product1 are in directory prod1, and those for product2 are in prod2.

Indexes for different locales

In most browsers, FindinSite-CD can find out the user's preferred locale, ie their computer's language and country settings. See the languages page for details of how to specify a locale, ie language code (and optionally country code).

You can specify a locale for each index. When it starts, FindinSite-CD will then use the most appropriate index.

For example, if endb is the English search database for your English web site, and frdb is search database for the French version of your web site, use the following parameters:

<PARAM NAME=index1 VALUE="endb,en">
<PARAM NAME=index2 VALUE="frdb,fr">

You may need to set a baseurl for your index parameters, as shown in the Base URLs box above.

Subsets - Searching more than one search database

An index may consist of more than one search database. In this case, your CD user views the index as having subsets, where each subset is a single search database, and a "Subsets" button appears to let them choose the subsets to include in the next search. See below if you want to turn off the "Subsets" button.

Remember from earlier that each indexN parameter value should be in this format, with a comma separating each field:

dbspec is either:
inline usage: semi-colon separated database specifiers - databaseURL[@baseurl[@selected]]
file usage: @fileURL

databaseURL and baseurl are as defined earlier. The optional selected sub-field is a true or false value, depending on whether you want the subset included in the user's search initially. selected is true by default.

Inline usage

Here are examples of inline usage:
<PARAM NAME=index1 VALUE="EngDb,en">
<PARAM NAME=index1 VALUE="EngDb;[email protected]/,en">
<PARAM NAME=index1 VALUE="EngDb;[email protected]/@false,en">
  • In the first case, there is just one search database - and therefore "Subsets" does not appear, unlike the following cases.
  • The second case, there are two search databases and therefore two subsets; the second search database has a baseurl of French/.
  • The third case is the same as the second, with the exception that the French subset is not included in the user's search initially because selected is false.
Subsets list file usage
The file usage lets you specify the subsets in another file, eg:
<PARAM NAME=index1 VALUE="@dbs.txt,en">

The file, ie dbs.txt in this case, must contain UTF-8 plain text in the following format:

One or more lines with databaseURL[@baseurl[@selected]]
index_description is the index name that is displayed by FindinSite-CD (instead of the dbspec).

IndexesFullList is true if you want FindinSite-CD to list the search database descriptions in the Indexes tab, in addition to the index_description. If false then only the index_description is displayed.
Remember that the Indexes tab is only displayable if you specify more than one index parameter.

This example of file usage shows a index named "All the CD" that consists of three subsets, with the German one not included in searches initially.
All the CD
[email protected]/
[email protected]/@false


The "Subsets" button appears if an index is selected that has more than one search database subset.

If you do not ever want to show the "Subsets" button then you must set a parameter ShowSubsets to no, eg:

<PARAM NAME=ShowSubsets VALUE="no">
If you set ShowSubsets to startup, then the Subsets tab is shown at startup once all the indexes have been loaded. However if the index only has one search database then the Subsets tab is not shown.
  All site Copyright © 1996-2011 PHD Computer Consultants Ltd, PHDCC   Privacy  

Last modified: 18 March 2010.

Valid HTML 4.01 Transitional Valid CSS!