•  
Main
About Hippo Site Toolkit 1
Technical Documentation
Expression Language
Other

<hippo:facets>

Description

The <hippo:facets> executes a faceted DASL query based on the location and stores the result in the var attribute.

Attributes

Attribute Type Required Rtexprvalue Description
location String true true The scope of the DASL query
var String true false The variable name in which the tag stores the result
query String false true Name of query class

Usage

<hippo:facets location="/" var="result" query="org.mycompany.query.QueryImpl">
    <hippo:queryParameter name="name" var="${param.name}"/>
    <hippo:queryParameter name="address" var="${param.address}"/> 
</hippo:facets>

<c:if test="${not (facetsCollection eq null)}">
  <c:forEach var="facet" items="${facetsCollection}">
    <b>Facet '${facet.name}'</b>
    <ul>
    <c:forEach var="facetValue" items="${facet.values}">
      <li>${facetValue.value} (${facetValue.hits})</li>
    </c:forEach>
    </ul>
  </c:forEach>
</c:if>
Performs a faceted query scoped at the root of the repository using the QueryImpl with two query parameters namely, name and address.

Example output

For a faceted query that selects on the 'type' property, the generegated output would be someting like this:

Facet 'type'

  • events (4)
  • news (4)
  • sitemap (1)
  • text (14)
  • tree (1)

When more properties are selected in the query, there will also be more facets shown in the output.