Custom Summaries


Funnelback's query processor is capable of generating several different types of summary for each search result, as detailed in the table below. Summary modes can be altered either via CGI parameters or through query_processor_options in collection.cfg

Summary modes

Summary ModeDescriptionEffect of Summary Fields
snippetPrint appropriately fielded words from start of doc.Which fields are appropriate
debugPrint every word with its field tagIgnored
metaPrint document metadataWhich fields to display
autoPrint metadata codes if specified in user queryWhich fields are appropriate
qbPrint query-biased summaryWhich fields are appropriate
bothPrint both a query-biased summary and metadata fieldsWhich fields are appropriate

Note: If an attempt to print a metadata summary or a query-biased summary is unsuccessful, a snippet will be shown. For efficiency reasons the query-biased summary mechanism will only look at a certain number of words into the document.

Default Summary behaviour

If no custom summary mode is stipulated (via the 'SM' query processor option) then the system will use the first 'description' metadata element found within the HTML markup. For example, given the following, very simple HTML markup:

    <meta name="dc.title" content="This is dc.title" >
    <meta name="description" content="this is the first description">
    <meta name="dc.description" content="this is the second description">
    <meta name="thisisadescription" content="this is a description element which has been added to metamap.cfg">
    <title>HTML Reference</title>
    <h1>My Heading</h1>
    <p>My paragraph.</p>
    This line is not particularly important. It is only used for testing purposes.

the 'description' element will be used as the summary.

Please note the following points:

  • The ordering of the 'description' metamap.cfg mappings is unimportant when it comes to the default summary.
  • The elements that are to be considered 'description' elements are defined in metamap.cfg - those mapped to the 'c' meta class

Using Metadata in Summaries

Enabling metadata summary mode requires an administrator to specify which metadata fields to use in the summary. The example below uses metadata fields a, c, and s:

query_processor_options=-SM=meta -SF=[a,c,s]

Displaying Metadata in the Public UI

The required meta fields must also be present in the search forms. The default Funnelback search forms contain the a, c, s and p fields. These can be modified to any desired metadata field by editing the search forms. Simply replace the letters and the description as shown in the example below.

Default simple.ftl file:

<#if s.result.metaData["c"]??><p>${s.result.metaData["c"]!}</p><p></#if>
<#if s.result.metaData["a"]??>
</span> ${s.result.metaData["a"]!}
<#if s.result.metaData["s"]??>
</span> ${s.result.metaData["s"]!}
<#if s.result.metaData["p"]??>
</span> ${s.result.metaData["p"]!}

Custom simple.ftl file:

<#if s.result.metaData["d"]??><p><span><span>Date:
<#if s.result.metaData["c"]??>
</span> ${s.result.metaData["c"]!}
<#if s.result.metaData["l"]??>
</span> ${s.result.metaData["l"]!}
<#if s.result.metaData["p"]??>
</span> ${s.result.metaData["p"]!}

Configuring Query-Biased Summaries

When using a query-biased summary mode (-SM=qb|both), additional controls can be applied to snippets:

Sentence Order

By default, sentences in a query-biased summary appear in the natural document order. However, it is possible to present them in order of decreasing match in relation to the supplied query e.g.


Number of Excerpts

By default, three sentences are used in a query-biased summary in the order specified. Additional sentences can be used to generate the query-biased summary e.g.


Summary Lengths

Summary Buffer Length

For the sake of efficiency, there is a limit to how much space is allocated for each generated summary. The default summary buffer length should be adequate for most uses. However, if summaries appear to be too short, then it may become necessary to increase the summary buffer length option to give Funnelback the space it needs to generate summaries. e.g.


The current default summary buffer length is 250 characters.

Metadata Buffer Length

The metadata buffer length determines the amount of characters each individual metadata field may hold. The default metadata buffer should be adequate for normal metadata field values. However, if the metadata output appears to be truncated it may be necessary to increase the metadata buffer length so that all data can be stored. e.g.


The current default metadata buffer length is 250 characters.


This example uses a metadata-based summary mode, returning the metadata fields author, type and description:

query_processor_options=-SM=meta -SF=[author,type,description]

This example uses a query-biased summary mode, with five excerpts being returned in order of relevance in the document:

query_processor_options=-SM=qb -SQE=5 -EORDER=1

This example uses both metadata and query-biased summaries, sourcing metadata fields f and subject, doubling the default length for both excerpts and metadata fields:

query_processor_options=SM=both -SF=[f,subject] -SBL=500 -MBL=500

See also