How to add fields to search reports

Article: dts0202


Applies to: dtSearch Desktop/Network

dtSearch 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.


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%%

%%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:


Template for a single item in the list format


Template for the file header in the report format


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


Symbols that can be included in the templates are:





Number of hits in the document


Name of the document. For PDF and HTML files, this will be the TITLE.


Full path and filename of the document


Modification date of the document


Location of the document


The file type (Microsoft Word, PDF, HTML, etc.


Size of the document


Size of the document in kilobytes


First 80 text characters of the document


The number of this item in the search results list


The path of the index that this document was found in


The date the search was performed


The date the search report was generated


Search request


Number of files retrieved in the search


Number of hits in all files retrieved in the search

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

How to change the way dtSearch prints search results



Copyright © 1991-2023 dtSearch Corp. All Rights Reserved.  /  Terms of use  /  Privacy