# Recoll user manual
Customizing the search interface

Sidebar | Prev | Up | Next

#### The result list format

Newer versions of Recoll (from 1.17) normally use WebKit HTML widgets for the result list and the snippets window (this may be disabled at build time). Total customisation is possible with full support for CSS and Javascript. Conversely, there are limits to what you can do with the older Qt QTextBrowser, but still, it is possible to decide what data each result will contain, and how it will be displayed.

The result list presentation can be exhaustively customized by adjusting two elements:

- The paragraph format

- HTML code inside the header section. For versions 1.21 and later, this is also used for the snippets window

The paragraph format and the header fragment can be edited from the Result list tab of the GUI configuration.

The header fragment is used both for the result list and the snippets window. The snippets list is a table and has a `snippets` class attribute. Each paragraph in the result list is a table, with class `respar`, but this can be changed by editing the paragraph format.

There are a few examples on the page about customising the result list on the Recoll web site.

##### The paragraph format

This is an arbitrary HTML string where the following printf-like `%` substitutions will be performed:

- %A. Abstract

- %D. Date

- %I. Icon image name. This is normally determined from the MIME type. The associations are defined inside the `mimeconf` configuration file. If a thumbnail for the file is found at the standard Freedesktop location, this will be displayed instead.

- %K. Keywords (if any)

- %L. Precooked Preview, Edit, and possibly Snippets links

- %M. MIME type

- %N. result Number inside the result page

- %P. Parent folder Url. In the case of an embedded document, this is the parent folder for the top level container file.

- %R. Relevance percentage

- %S. Size information

- %T. Title or Filename if not set.

- %t. Title or Filename if not set.

- %U. Url

The format of the Preview, Edit, and Snippets links is `<a href="P%N">`, `<a href="E%N">` and `<a href="A%N">` where `docnum` (%N) expands to the document number inside the result page).

A link target defined as `"F%N"` will open the document corresponding to the `%P` parent folder expansion, usually creating a file manager window on the folder where the container file resides. E.g.:

    <a href="F%N">%P</a>

A link target defined as `R%N|`scriptname`` will run the corresponding script on the result file (if the document is embedded, the script will be started on the top-level parent). See the section about defining scripts.

In addition to the predefined values above, all strings like `%(fieldname)` will be replaced by the value of the field named `fieldname` for this document. Only stored fields can be accessed in this way, the value of indexed but not stored fields is not known at this point in the search process (see field configuration). There are currently very few fields stored by default, apart from the values above (only `author` and `filename`), so this feature will need some custom local configuration to be useful. An example candidate would be the `recipient` field which is generated by the message input handlers.

The default value for the paragraph format string is:

        "<table class=\"respar\">\n"
        "<tr>\n"
        "<td><a href='%U'><img src='%I' width='64'></a></td>\n"
        "<td>%L &nbsp;<i>%S</i> &nbsp;&nbsp;<b>%T</b><br>\n"
        "<span style='white-space:nowrap'><i>%M</i>&nbsp;%D</span>&nbsp;&nbsp;&nbsp; <i>%U</i>&nbsp;%i<br>\n"
        "%A %K</td>\n"
        "</tr></table>\n"

You may, for example, try the following for a more web-like experience:

    <u><b><a href="P%N">%T</a></b></u><br>
    %A<font color=#008000>%U - %S</font> - %L

Note that the P%N link in the above paragraph makes the title a preview link. Or the clean looking:

    <img src="%I" align="left">%L <font color="#900000">%R</font>
    &nbsp;&nbsp;<b>%T&</b><br>%S&nbsp;
    <font color="#808080"><i>%U</i></font>
    <table bgcolor="#e0e0e0">
    <tr><td><div>%A</div></td></tr>
    </table>%K

These samples, and some others are on the web site, with pictures to show how they look.

It is also possible to define the value of the snippet separator inside the abstract section.

Prev | Up | Next
| Home |