<@td.groupSearch>

Example usage:

When content is written in DITA, search results are "grouped" by topic, with each individual search result within that group representing the topic as it appears in a given context. To facilitate this, the Group Search tag differs from the Search tag in the following ways.

  • It takes one additional optional attribute, resultsPerGroup that specifies the maximum number of "contexts" to return per group.
  • The data placed into @var is an instance of SearchResultsPage instead of a list of SearchResultDocuments.

The body of this tag can contain any number of <@td.metadataFilter> tags.

<@td.groupSearch var="results" query="Titania" />

<ul>
  <#list results.content as group>
    <li>${group.firstResult.title?html}</li>
    <ul>
      <#list group.results as result>
        <li><a href=<@td.viewerUrl searchResult=result />>${result.contextName}</a></li>
      </#list>
    </ul>
  </#list>
</ul>
Note: Non-DITA content and DITA topics not referenced by any DITA map will only have a single entry in result.content.results which will be identical to result.content.firstResult. Additionally, Portal Theme developers may want to create custom viewer pages for non-DITA content types.