Funnelback logo

Documentation

Custom Summaries

Introduction

Document summaries are generated by the query processor (padre-sw). PADRE is capable of generating several different types of summary as detailed in the table below. Summary behaviour is controlled by various query_processor_options e.g. summary mode (-SM), summary fields (-SF), summary buffer length (-SBL) and metadata buffer length (-MBL):

-SM[snippet|debug|meta|auto|qb|both]
-SF<summary_fields>
-SBL<number of characters>
-MBL<number of characters>

For example, to generate metadata summaries and to include metadata fields a, c, p, and s, change the collection.cfg file to include the line:

query_processor_options=-SMmeta -SFacps

Summary modes

Summary Mode Description Effect of Summary_fields
snippet Print appropriately fielded words from start of doc. Which fields are appropriate
debug Print every word with its field tag Ignored
meta Print document metadata Which fields to display
auto Print metadata codes if specified in user query Which fields are appropriate
qb Print query biased summary Which fields are appropriate
both Print both a query biased summary and metadata fields Which fields are appropriate

To enable "meta" summary mode, 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.

With the Modern UI

Default simple.ftl file:

<#if s.result.metaData.c?exists><p>${s.result.metaData.c!}</p></#if>
<#if s.result.metaData.a?exists><span><span>by </span> ${s.result.metaData.a!}</span></#if>
<#if s.result.metaData.s?exists><span><span>Keywords:</span> ${s.result.metaData.s!}</span></#if>
<#if s.result.metaData.p?exists><span><span>Publisher:</span> ${s.result.metaData.p!}</span></#if>

Custom simple.ftl file:

<#if s.result.metaData.d?exists><span><span>Date:</span>${s.result.metaData.d!}</span></#if>
<#if s.result.metaData.c?exists><span><span>Description:</span> ${s.result.metaData.c!}</span></#if>
<#if s.result.metaData.l?exists><span><span>Language:</span> ${s.result.metaData.l!}</span></#if>
<#if s.result.metaData.p?exists><span><span>Publisher:</span> ${s.result.metaData.p!}</span></#if>

With the Classic UI

Default simple.form file:

resif{md_a}{<b>Author:res{md_a}<br>}
resif{md_c}{<b>Description: res{md_c}<br>}
resif{md_s}{<b>Keywords: res{md_s}<br>}
resif{md_p}{<b>Publisher: res{md_p}<br>}

Custom simple.form file:

resif{md_d}{<b>Date:res{md_d}<br>}
resif{md_c}{<b>Description: res{md_c}<br>}
resif{md_l}{<b>Language: res{md_l}<br>}
resif{md_p}{<b>Publisher: res{md_p}<br>}

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 a certain number of words into the document.

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.

query_processor_options=-EORDER1

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.

query_processor_options=-SBL450

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.

query_processor_options=-MBL1000

The current default metadata buffer length is 250 characters.

Backwards Compatibility with Earlier Releases

From Funnelback 5.5.0, the result title field returned in the query processor's XML result packet will be protected by a CDATA section and will not be HTML encoded. The interface wrapper, search.cgi, has taken on the responsibility for stripping the CDATA markup and converting the encapsulated text into HTML encoded form.

The summary field will be HTML encoded text, and not CDATA.

For installations that use the standard search.cgi script as the interface wrapper, Funnelback will continue to behave correctly. For installations that have developed custom search wrappers, two options are available:

  1. Modify the interface wrapper to strip the CDATA sections and HTML encode the title and metadata summary elements.
  2. Add the command line argument -nocdata to the query_processor_options and indexer_options settings in the collection.cfg file to revert back to the previous behaviour (i.e. no CDATA protection and titles and metadata fields are HTML encoded by the query processor). For example,
indexer_options=-nocdata
...
query_processor_options=-SMmeta -SFacds -nocdata

See also

top ⇑