How to add custom fields to dtSearch Web search results

Article: dts0158

Applies to: dtSearch Web/Publish

In addition to basic information about a file, such as the filename, date, and size, dtSearch Web can also display customized fields Based on document properties. For example, you could display the Subject property of a PDF file or the Author property of a Word document.

To set up a custom field to appear in search results, there are two steps: (1) Tell dtSearch the name of the field so that when dtSearch indexes the documents, it will get the contents of the field and store them in the index so they can be displayed in search results. (2) Customize the search results format in dtSearch Web Setup to include the field.

Suppose you want to display the Subject property in search results. First, tell dtSearch that the Subject property should be stored in the index so that it can appear in search results. To do this,

(1) Click Index > Create (Advanced)

(2) Set up the index name and location, and under Fields to display in search results, enter Subject, along with any other fields that you may want to display.

(3) Index the documents that have the Subject field.

To see if dtSearch found the Subject field in your documents, do a search in dtSearch Desktop. There should be a new Subject column in the search results list.

The next step is to tell dtSearch how the Subject field should appear in dtSearch Web. dtSearch Web keeps the search results format with each search form, so you will need to create a new search form. (The following steps assume that you have already set up dtSearch Web. If you have not, please see the dtSearch Web Quick Start for instructions on setting up dtSearch Web.)

(1) Click dtSearch Web Setup in the File menu

(2) Click the Build Search Form button

(3) Click the Indexes tab and select the indexes that you want to include on this search form.

(4) Click the Search Results tab

(5) Click the Add... button to add an item to search results. The Search Results Item dialog box will appear.

(6) Under Name enter Subject

(7) Under Label to appear in search results enter <B>Subject: </B>

(8) Under Content enter %%Subject%%

(9) Click OK to close the Search Results Item dialog box, then click OK again to build the search form.

When you search using the form you just built, the search results list will include the Subject field.

Additional Information

For information on customizing search results generally in dtSearch Web, please see the Customizing the search results format topic in the dtSearch Web help file (dtSearch_Web.chm).

For information on editing the dtSearch_options.html file directly to customize search results format, please see the Generated files topic in the dtSearch Web help file.

Related Topics

How to get field data in search results

How to add fields to documents