Meta collections
Introduction
A meta collection is a collection that allows users to search over one or more existing collections at the same time. For example, if you had two web collections, one for the external internet site and a second for the internal intranet, you could create a meta collection comprising the two collections to allow internal users to search both sites.
Meta collections operate in a similar manner to standard collections, except that they are not updated: the individual collections must be updated instead.
Creation
Creating a meta-collection foolws the normal collection creation process, however after creation the components (or sub-collections) of the meta collection must be configured via the "Edit Meta Components" screen shown under the "Administer" tab on the home page.
Note that if any of the selected base collections have early binding document level security, the following option must be added to the collection.cfg file for meta collection to maintain security processing for those component collections:
security.earlybinding.user-to-key-mapper=Meta
Displaying results in a meta collection
If your meta-collection comprises a number of different collection types, for example a web plus a database collection, then the search results will be a heterogeneous mix of records. The meta-collection's search templates should use an <#if />
FreeMarker clause to identify the child collection and format the record appropriately.
For example, if you had a database collection called library you could format results differently with the following:
<#if r.collection == "library">
<a href="${r.cacheUrl}">${r.title}</a>
<b>Library Record</b> - ${r.date?date?string.short}
<#if r.metaData["y"]?exists>
<span class="summary_label">ISBN:</span><${r.metaData["y"]}<br />
</#if>
</#if>
<#if r.collection != "library">
<a href="${r.cacheUrl}">${r.title}</a>
<b>Other Record</b> - ${r.date?date?string.short}
<#if r.metaData["a"]?exists>
<span class="summary_label">Author:</span><${r.metaData["a"]}<br />
</#if>
</#if>
Note that r.cacheUrl
is used for the links to the library records as they are the rows extracted from the database (as XML files).
You might also use a hook script to transform the results so that results from a specific sub-collection are processed in a particular way.
Meta collection scoping and ranking options
Scoping search results to a component collection
Search results can be restricted to a list of component collections at query time by supplying the clive
CGI parameter or query processor option.
Example: restrict results to the intranet and staffdir components of the internal-search collection:
Using CGI clive
parameter(s):
http://FUNNELBACK_SERVER/s/search.html?collection=internal-search&query=hr&clive=intranet,staffdir
or
http://FUNNELBACK_SERVER/s/search.html?collection=internal-search&query=hr&clive=intranet&clive=staffdir
Using a query processor option (e.g. on a profile's padre_opts.cfg
) specifying -clive
parameters for each component:
-clive=intranet -clive=staff
Filter the search results by component collection
Filtering of results by collection can be achieved by configuring faceted navigation with category values based on source collection.
Same collection suppression
Same collection suppression is a result diversification option that allows the downweighting of consecutive results from the same component collection.
Upweighting or downweighting results from a component collection
It is possible to upweight or downweighting results based on the collection that they are sourced from.
See: Meta collections: relative weighting