Last Reviewed: July 6, 2005

Article: DTS0202

     

Applies to: dtSearch Desktop 6, 7

dtSearch Desktop can generate a report listing each hit found in each document, or just listing the documents retrieved.  To generate this list, click Search > Search Report in dtSearch Desktop.

Templates

The templates used to generate these reports are RTF files, which you can edit in Microsoft Word to change the layout of the report or to add additional fields.  The template files are installed to:

C:\Program Files\dtSearch\template\SearchReportTemplate.rtf (the report format showing hits in context)

C:\Program Files\dtSearch\template\SearchListTemplate.rtf (the report format showing a simple list of files)

To create a custom template, edit one of these files and save the edited template in your dtSearch UserData folder.

Template file format

The template files use symbols like %%Filename%% to represent information about each document.  For example, the list template looks like this:

Search Request: %%Request%%
                  Total files: %%TotalFiles%%
                  Total hits: %%TotalHits%%
<<<ListItem

%%Filename%% (%%Hits%% hits)

Location: %%Location%%  Size: %%Size%% Last modified: %%Date%%

>>> 

Text between the << >> markers defines the template for each search results item.   Text before the first <<< marker is the header.  Text after the >>> marker is ignored.  The sections in the template are:

ListItem

Template for a single item in the list format

FileHeader

Template for the file header in the report format

ContextHeader

Template for the header in front of each block of context in the report format

 

Symbols that can be included in the templates are:

 

Symbol

Meaning

%%Hits%%

Number of hits in the document

%%Filename%%

Name of the document

%%Date%%

Modification date of the the document

%%Location%%

Location of the document

%%FullName%%

Complete path and filename of document

%%Title%%

First 80 text characters of the document

%%Request%%

Search request

 %%Size%%

Size of the document

%%TotalFiles%%

Number of files retrieved in the search

%%TotalHits%%

Number of hits in all files retrieved in the search

%%Page%%

Page number where a hit occurred

%%Paragraph%%

Paragraph (within the page) where a hit occurred

Adding custom fields

To add custom fields to a search report,

(1) Index the documents with the fields listed as "stored" fields.   For information on how to do this, see:  "How to get field data in search results"

(2) Add a symbol for the stored field to the search report template, by putting %% marks around the name of the field.  For example, to insert the Sender, Recipient, and Subject fields from email messages, add this to the template:

Subject:    %%Subject%%

Sender:     %%Sender%%
Recipient:  %%Recipient%%

For a list of the fields that dtSearch automatically detects in documents, see "What file formats does dtSearch support?"

Related Articles

How to add custom fields to dtSearch Web search results

How to get field data in search results