Release 1.3 - ...
<facet> element
A facet definition contains the facet query itself and the query-parts (WHERE and JOIN statement(s)) which must be used within the main search query.
Each facet must have an unique name, and this same name must be re-used in the WHERE definition.
Optionally you can specify a datatype for a facet (defaults to string).
Example
XML |
Copy Code
|
<facet name="contenttype" enabled="true" datatype="integer" mode="or" allowinvert="true" displayname="Contenttype">
<facet_fields>ct.Nr, vt.Count, ct.Name, ROW_NUMBER() OVER (ORDER BY vt.Count DESC) AS rownum </facet_fields>
<search_fields> count(*) as Count, c.ContentType </search_fields>
<query><![CDATA[
SELECT {this.facetselectfields()} FROM (
{this.searchquery()}
GROUP BY c.ContentType
) vt
JOIN ContentTypes ct ON vt.contenttype=ct.nr
]]>
</query>
<joins></joins>
<where> c.ContentType=?:contenttype </where>
</facet>
|
Attributes
Attribute name |
Required |
Description |
name |
Yes |
The (unique) name of the facet. |
displayname |
Yes |
The displayname of the facet. |
enabled |
Yes |
Attribute which can be used to filter out facets which are not enabled. |
datatype |
No |
The datatype of the facet. Defaults to string. |
userinput |
No |
Boolean (defaults to true) to indicate whether or not the facet does require user input. When the facet definition is fixed (not dependent on user input) you should set this attribute to false. |
allowinvert |
No |
Determines whether or not inversion of the facet selection is allowed.
For example, when Web Page has been selected for the contenttype facet and allowinvert equals true, the facet will display the option to invert the selection. This means that the result will include every item for which the contenttype doesn't equal Web Page. |
mode |
No |
Specifies the multi-select mode (and, or, andor). If multi-select shouldn't be allowed, single must be specified. Defaults to single.
When mode has been set to or, it is possible to get results where e.g. contenttype equals Web Page or Strict Web Page. |
Parent element
Element name |
Description |
<facets> |
Parent element for one or more facet configuration element(s).
|
Child elements
Element name |
Description |
<facet_fields> |
Defines the fields to use within the facet query. |
<search_fields> |
Defines the fields to use within the (master) searh query. |
<query> |
Defines the facet query. |
<joins> |
Defines additional JOIN statement(s) which must be appended to the (master) search query. |
<where> |
Specifies the WHERE statement for this facet. |