Set up result collapsing groups

Background

Before you can apply any result collapsing, you need to determine what will be used to group, or collapse, the results.

Results are grouped together if they contain the same value in one or more metadata fields, or as their extracted text signature.

Consider the following set of books:

Title Author Genre Format

Harry Potter and the Goblet of Fire

J.K. Rowling

Children

Paperback

Murder on the Orient Express

Agatha Christie

Crime

Paperback

Harry Potter and the Chamber of Secrets

J.K. Rowling

Children

Hardback

Death on the Nile

Agatha Christie

Crime

Paperback

The BFG

Roald Dahl

Children

Paperback

The Crocodile Bird

Ruth Rendell

Crime

Hardback

2001: A Space Odyssey

Arthur C. Clarke

Science Fiction

Hardback

If we grouped these by the format metadata we would get two results when we ran a search with all the paperback items grouped under one result, and all the hardback items grouped as the second search result.

We would like to group our search results by author, genre, format and genre-format.

Given this we need to create the following groupings:

  • author

  • genre

  • format

  • genre + format

Once the groupings are configured you can tell Funnelback which grouping to apply when you run a search.

When you group by multiple fields, the grouping only occurs if all the listed fields have the same values. e.g. in the example above only the children+paperback and crime+paperback items would be grouped. All the other items would be returned as single items in the search results.

Configuring the groupings

Once you have determined which fields will be used for groupings you need to configure the affected data sources to account for these groupings.

To do this:

  1. Switch to the data source containing the items you need to group

  2. Edit the data source configuration and add the indexing.collapse_fields configuration setting.

    Each grouping should be a comma-separated list of metadata class names surrounded by square brackets, and the set of groupings should be provided as a comma separated list.

    If the metadata is not currently in the search index you will need to configure your metadata mappings before you can configure result collapsing.

    For example, to set up the four groupings from the previous example:

    Configuration option Value

    indexing.collapse_fields

    [$],[author],[genre],[format],[genre,format]

    The [$] grouping is a special grouping that groups on a document signature that should always be included as it is used by content auditor to identify duplicate content.
  3. Update or re-index the data source to apply the groupings to the search index.

    You can check that your groupings are correctly applied by looking at the Step_BuildCollapsingSignatures.log in your data source log files.
  4. Repeat this process for each data source that contains items that should be included in the groupings.

See also