Configure the automatically generated result summary

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 by setting query_processor_options in your results page configuration.

Summary modes

Summary mode description

both (default)

Returns a description or query-biased summary in the result’s summary field and the metadata field values specified in the summary fields (-SF) option in the result’s listMetadata object.

qb

Print a query-biased summary in the result’s summary field. This returns sentence fragments that consist of search query terms with some surrounding text to provide context. The query-biased summary is generated from the un-fielded document content associated with the result.

meta

Print only metadata values as specified in the summary fields (-SF) option. This disabled result summaries and the result’s summary field will contain an empty value.

snippet

Print a generated summary extracted from un-fielded words at the start of the document in the result’s summary field.

auto

Print metadata codes if specified in user query.

off

Disables all summaries and prevents metadata being returned in the search results and data model

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 behavior

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 an internal metadata class">
<title>HTML Reference</title>
<h1>My Heading</h1>
<p>My paragraph.</p>

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

Please note the following points:

  • The ordering of the 'description' metadata mappings is unimportant when it comes to the default summary.

  • The elements that are to be considered 'description' elements are defined in the metadata mappings, mapped to the 'c' metadata class.

Using metadata in your search results

Presentation of metadata with search results requires a search administrator to specify which metadata fields to present using the -SF option. The example below uses metadata fields author, c, and keyword:

query_processor_options= -SF=[author,c,keyword]

This will configure Funnelback to populate the listMetadata element of each search result with author, c and keyword metadata values, if available.

Displaying metadata in the search results

The required metadata fields must also be presented within the search forms. The default Funnelback search forms contain the author, c, keyword and publisher fields. These can be modified to any desired metadata field by editing the search templates. Simply replace the metadata classes and the description as shown in the example below.

Default simple.ftl file:

<#if s.result.listMetadata["c"]?first??>
    ${s.result.listMetadata["c"]?first!}
</#if>
<#if s.result.listMetadata["author"]?first??>
    by: ${s.result.listMetadata["author"]?first!}
</#if>
<#if s.result.listMetadata["keyword"]?first??>
    Keywords: ${s.result.listMetadata["keyword"]?first!}
</#if>
<#if s.result.listMetadata["publisher"]?first??>
    Publisher: ${s.result.listMetadata["publisher"]?first!}
</#if>

Custom simple.ftl file:

<#if s.result.listMetadata["d"]?first??>
    Date: ${s.result.listMetadata["d"]?first!}
</#if>
<#if s.result.listMetadata["c"]?first??>
    Description: ${s.result.listMetadata["c"]?first!}
</#if>
<#if s.result.listMetadata["language"]?first??>
    Language: ${s.result.listMetadata["language"]?join(", ")}
</#if>
<#if s.result.listMetadata["publisher"]?first??>
    Publisher: ${s.result.listMetadata["publisher"]?first!}
</#if>

Configuring query-biased summaries

When using the query-biased summary mode (-SM=qb), 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.

For example:

query_processor_options=-EORDER=1

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.

For example:

query_processor_options=-SQE=4

Metadata and query-biased summaries

Metadata is not included in the content used to generate query-biased summaries, even if you have chosen the option to index as content.

XML data and query-biased summaries

The result’s summary element will be empty unless your XML is configured to include some un-fielded content.

This is configured from the data source XML processing configuration screen, under the special document elements section. You must configure one (or more) of the following:

  • Indexable document content - this is used to specify a set of fields to explicitly index as unfielded XML content. Note: you can’t specify a field here if it’s been mapped to a fielded metadata class from the metadata mapping screen.

  • Index unmapped elements as content - when selected this will consider any XML field detected in the document that isn’t mapped via the metadata screen as unfielded content.

  • Inner HTML of XML document - the contents of this field will be processed and handled as an HTML or XML document and indexed based on the metadata configuration. Note: you can’t specify a field here if it’s been mapped to a fielded metadata class from the metadata mapping screen.

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. For example:

query_processor_options=-SBL=450

The current default summary buffer length is 250 characters.

Summarizable text limit

The indexer includes a limit on the amount of text used to create summaries to 50,000 characters per document. This can be increased using the -rstxt indexer option.

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. For example:

query_processor_options=-MBL=1000

The current default metadata buffer length is 250 characters.

Examples

This example uses a metadata-only 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

All summary text

The complete summary text can be returned in the result’s all_summary_text field by setting the following query processor option: -all_summary_text=true.