Description

The filter directive is to be used within the Query tag.

Filter

Remove All Filters with Field Name

<search:query parameters="*" var="query">
    <query:filter field="company" action="remove""></query:filter>
</search:query>

Add Filter

<search:query parameters="*" var="query">
    <query:filter field="company" value="twigkit"></query:filter>
</search:query>

Remove Filter

<search:query parameters="*" var="query">
    <query:filter field="company" value="twigkit" action="remove"></query:filter>
</search:query>

Range Filter

Add Filter

<search:query parameters="*" var="query">
    <query:filter field="age" from="25" to="50" display="25 to 50"></query:filter>
</search:query>

Remove Filter

<search:query parameters="*" var="query">
    <query:filter field="age" from="25" to="50" display="25 to 50" action="remove"></query:filter>
</search:query>

Usage

as element:
<query:filter
       field="{string}"
       [value="{string}"]
       [from="{Number|Date}"]
       [to="{Number|Date}"]
       [display="{string}"]
       [optional="{string}"]
       [exclude="{boolean}"]
       [action="{string}"]
       [hidden="{boolean}"]
       [match="{string}"]
       [type="{string}"]>
</query:filter>

Parameters

ParamTypeDetails
fieldstringThe field the filter applies to.
value (optional)stringThe value to apply to the field
from (optional)Number]link:[DateThe from value for the range filter.
to (optional)Number]link:[DateThe to value for the range filter.
display (optional)stringThe display value for the range filter.
optional (optional)stringIf the filter is optional (or) (field or value)
exclude (optional)booleanIf the filter should exclude values matching this filter.
action (optional)stringWhether to remove the filter or add the filter. (Default:‘add’)
hidden (optional)booleanWhether the filter should be hidden (visible in breadcrumbs and URLs) or not.
match (optional)stringDetermines whether to match the value of the filter exactly, or partially, with either left or right wildcards. Accepted values are ‘left_partial’ or ‘partial’ or ‘right_partial’ or ‘exact’.
type (optional)stringExplicitly set the type of the filter, ‘string’ or ‘number’. A string filter value will be wrapped in double quotes.