Customizing Facets and Drill Down Navigation
Facets were introduced in eZ Find 2.0 to enable you to create browse-based search functionality. In other words, the search results can be further narrowed after the original search has been made. This is sometimes called “drilling down” into the results. Facets refer to the characteristics of the content objects in the results, such as their class, author, and translation. The default templates provide some simple facet examples, although eZ Find is capable of providing much more functionality.
In order to use facets you must customize the search templates. To make this easier, the template operators facetParameters and filterParameters have been added, which provide default parameters to implement facet functionality. Facet-related parameters are described in more detailed in the next section about the eZ Find fetch function.
Range Facets
Audience
This feature is for (template) developers building advanced search and navigation interfaces.
Goals and Use Cases
Range facets are a general type of facets, like date facets. They should be used to stitch together what otherwise could also be obtained with discrete query facets operating on numeric and date types.
Important: Range facets should also be used for date facets as the latter one is deprecated also in Solr!
How to Use
There can be multiple range facets specified, just like the field facets (but unlike the date facets in previous releases, where only one date facet could be called per fetch query).
Example of template code:
fetch( ezfind, search, hash( 'query', '$queryString, facet',array( hash( 'range', hash('field', 'published', 'start', 'NOW/YEAR-3YEARS', 'end', 'NOW/YEAR+1YEAR', 'gap', '+1YEAR' ) ) ) ) )
The parameters accepted as a hash array for the 'range' facet type are:
Name |
Required |
Value/Description |
field |
yes |
The field name to use (meta data or attribute). |
start |
yes |
Range start: any value valid for the numeric/data type. |
end |
yes |
Range end: any value valid for the numeric/data type. |
hardend |
no |
Strig 'true' or 'false' (default) instructing Solr what to do if the intervals do not divide nicely between start and end. If 'true', the 'end' parameter will be enforced. Otherwise, the gap will be used to determine the real end value. |
other |
no |
String. Will be used to tell the back end to provide more, less, all or no counts other than the ones in specified range:
|
include |
no |
By default, the ranges used to compute range faceting between range start and range end. The lower bounds are inclusive and the upper bounds are exclusive (i.e.: the 'before' range is exclusive and the 'after' range is inclusive). This is the default behaviour, equivalent to 'lower' (see description below), and will not result in double counting at the boundaries. This behaviour can be modified by the facet range.include parameter, which can be any combination of the following options:
|
Geir Arne Waaler (05/10/2011 2:15 pm)
Andrea Melo (16/05/2012 2:08 pm)
Comments
There are no comments.