How to display links to the original files in dtSearch Web

Article: dts0193

Applies to: dtSearch Web/Publish

dtSearch Web and dtSearch Publish can create two types of links in search results: highlighted links, which tell dtSearch Web to convert a retrieved file to HTML with hits highlighted, and un-highlighted links, which cause a document to open in its native application.

Changing the link type for all files

To change the link type with the dtSearch "Build Search Form" tool, click the "Search Results" tab

(1) Click the Search Results tab,

(2) Click on the item in search results that has the link to the original document, and

(3) Click the Modify button to change the link type

You can also change the link type by editing the dtsearch_options.html file. Open the file in notepad and look for the ResultsTableItem section. When dtSearch Web generates search results, it uses the text in this section as a template for the HTML that appears in search results. The %%HighlightLink%% symbol will be replaced by a link that produces hit highlighting, and the %%DirectLink%% symbol will be replaced by a direct link to the document (which will open the document in its native viewer). Therefore, to convert a link from highlighted to direct, just replace %%HighlightLink%% with %%DirectLink%%. You can also include both link types in each search results item, if you want to give users a choice to view documents either way.

Creating local file links in dtSearch Publish

In addition to %%DirectLink%% and %%HighlightLink%%, dtSearch Publish supports a third link type, %%LocalLink%%. LocalLink generates links using the path to a file on disk, to provide a way to launch files in their native application. For example, suppose you have created a CD with content stored in c:\SampleCD\root\data\docs, and a document named example.doc is included in search results. A %%DirectLink%% link to the file would result in a link that looks like this:

https://localhost/docs/example.doc

This type of link causes a file to be opened within the web browser window.

A %%LocalLink%% link for the same file would be:

c:\SampleCD\root\data\docs\example.doc

This type of link usually causes the file to open in its native application.

Changing the link type for specified file types

dtSearch Web has an option to specify that certain file types should always be displayed without conversion to HTML. In the Build Search Form tool, click "Document Display Options" and, under "File types to display without conversion to HTML", list the extensions of the file types that you want to appear in their native viewer. For example, to make Excel and Word files appear in Excel and Word, include DOC and XLS in the list.

In the dtsearch_options.html file., this is the "UnconvertedTypes" setting.