The Options File

cThe option settings in dtsearch_options.html control the appearance of search results and retrieved files, generation of the synopsis, logging, and other options

Each setting is bracketed with HTML comments, like this:

<!-- $Begin DocHeader -->

%%Filename%% (%%HitCount%% hits)

<!-- $End -->

The text that appears between the $Begin and $End comments has to be valid HTML.  Text that is not between $Begin and $End comments is ignored, and can be used to insert explanatory comments.

Template Settings

Because dtsearch_options.html is a valid HTML file, you can edit it directly in an HTML editor to change the appearance of retrieved documents or search results.  When editing the HTML, be careful to keep the $Begin and $End comments around each option setting.




Text displayed above each retrieved document


Text displayed below each retrieved document


JavaScript inserted in each retrieved document to enable hit navigation


Text displayed above each search results list


Text displayed below each search results list


JavaScript inserted in each search results list to enable navigation between documents.


Text displayed before each hit in a document


Text displayed after each hit in a document


Top row of search results table (for column labels)


Format of each item in the search results table


End of search results table (generally </table>)


In ResultsTableItem, the following symbols identify where document-related information is displayed:




Hit count


Hit count, counting a phrase as a single hit


List each word or phrase found in the search and the number of hits for each


Name of the retrieved document


Brief snippet of text showing the first hits in the document with a few words of context around each hit.  See Synopsis Settings, below.


Path to the retrieved document


Modification date of the document


Size of the document in kilobytes


Size of the document in bytes


Text from the first few lines of the document, or the TITLE of an HTML document


The string to be used for the HREF for an http: link to the document without hits highlighted (to directly open a file over a web connection)


The string to be used for the HREF for a link to the document with hits highlighted


The string to be used for the HREF for a link to the local path to the document (for use with dtSearch Publish only)


Sequential number of this item in the search results list (1, 2, 3, ...)


The search results format can also include a string that tells dtSearch Web to include the search form at the end of the search results list.  This string is:


Link Types

ResultsTableItem usually will contain one or more links to open the retrieved document.  In these links, use %%DirectLink%%, %%HighlightLink%%, or %%LocalLink%% to specify the type of link you want.  For example:

<a href="%%HighlightLink%%">%%Filename%%</a>

This would produce a link with the name of the document in the link.  When clicked, the document would open with hits highlighted.

If you want to open the file without highlighting, to allow the native viewer for the file to open it, use either %%DirectLink%% or %%LocalLink%%.  %%DirectLink%% produces a link to the file using http, and is appropriate for use over a web connection (example:  %%LocalLink%% produces a link to the location of the file on disk (example: c:\documents\sample.doc) and is appropriate for use in dtSearch Publish or to give users on a LAN direct access to files.

Option Settings

The options file also contains settings that control searching behavior and the way links and file information appear in search results.




Highlight each search term using a different color, instead of using one color for all terms


Ten six-digit hex color codes to use as the highlighting colors if MultiColorHighlighting is enabled


Display PDF files as plain text instead of using the browser's default PDF viewer.


Specify the weight for hits that occur in fields. Example: subject:10, HtmlTitle:15


Disable JavaScript in retrieved HTML files


Use the Title of HTML files as the filename


Use the Title of PDF files as the filename


Maximum size of a URL to generate


Maximum number of words to match in a single search


Message to display when too many words matched


File types to display without conversion to HTML


Message to display when no files are retrieved


Highlight hits in documents indexed via HTTP (using the dtSearch Spider)


Proxy server to use to access web resources


Server address for the dtSearch Web server in search results.  (Specify only if it is necessary to override the automatically-detected server name.)

Synopsis Settings

The %%Synopsis%% symbol in search results represents a brief snippet of text including the first hits in each document, with a few words of context around each hit.  The settings below provide options to customize how the synopsis is generated.  

Generating a synopsis requires that dtSearch Web open the original document and scan through it to extract the text around each hit, which can be a time-consuming operation.  To make generation of a synopsis faster, enabling caching of text when you create the index of the documents.  For more information on this option, see "Caching Text" in the dtSearch Desktop help file.

dtSearch Web will format the synopsis so it can be inserted into a search results table.  Line breaks, paragraph formatting, colors, and extra spacing will all be removed to produce a simple snippet of text, with hits marked in bold.




Number of blocks of context to include in the synopsis.


Text to include in front of each block of context.


Number of words to include around each hit in the synopsis.


Number of words in each document to scan looking for blocks of context to include in the synopsis.

Log Settings

To enable logging in dtSearch Web, check the Log document access or Log searches checkboxes in the File tab of the Form Builder dialog box.  This will set up the search form for default logging of search requests or document access.  The options, like the options for document display, are controlled by a list of templates that you can customize by editing the generated options file.




Set to 1 to enable logging of all search requests


Set to 1 to enable logging of document access


Template used to generate the filename for the document access log


Template used to generate a single entry in the document access log


Template used to generate the filename for the search log


Template used to generate a single entry in the search log


The two filename templates, DocumentLogNameTemplate and SearchLogNameTemplate, are used to generate log filenames.  By building date symbols into the log name, you can have a new log file start every day, month, or year. Example:


The two item templates, SearchLogItemTemplate and DocumentLogItemTemplate, are used to generate the lines added to the log file.  The following symbols can be used in the templates to customize the content of the logs:




The date and time of the search


"OK" if the request succeeded, "DENIED" if access was denied, "FAILED" on other errors


The value of the REMOTE_USER HTTP variable (unless your site requires a login, it will be blank)


The value of the REMOTE_ADDR HTTP variable (the IP address of the user accessing the site)


The name of the document accessed (document log only)


The user's search request (search log only)


The value of the fileConditions form variable (search log only)


The value of the booleanConditions form variable (search log only)


The index (or indexes) searched (search log only)


The number of documents retrieved (search log only)


The month of the search (01-12)


The day of the search (01-31)


The year of the search (4-digit)

The log files are generated in CSV format, which you can import into Excel or most databases.