Closes the SimpleFilter
valueContainer
.
Return the debug info about this component.
Un-selects the specified value.
The value whose state the method should reset.
Disable the component. Normally this means that the component will not execute handlers for the framework events (query events, for example). Components are enabled by default on creation.
Enable the component. Normally this means that the component will execute handlers for the framework events (query events, for example). Components are enabled by default on creation.
Return the bindings, or environment, for the current component.
Gets the captions of the currently selected field values in the SimpleFilter
.
An array containing the selected captions.
Gets the caption of a specific field value.
The field value whose caption the method should attempt to get.
The value caption, if available; the original value otherwise.
Gets the SimpleFilter
valueContainer
.
The SimpleFilter
valueContainer.
Opens the SimpleFilter
valueContainer
.
Resets the component to its original state.
Selects the specified value. Also triggers a query, by default.
The value to select.
true
by default. If set to false
, the method triggers no query.
Opens or closes the SimpleFilter
valueContainer
, depending on its current state.
Selects or un-selects the specified value, depending on its current state.
The value whose state the method should toggle.
Get the bound component to the given HTMLElement. Throws an assert if the HTMLElement has no component bound, unless using the noThrow argument.
If there is multiple component bound to the current HTMLElement, you must specify the component class.
HTMLElement for which to get the bound component.
Optional component class. If the HTMLElement has multiple components bound, you must specify which one you are targeting.
Boolean option to tell the method to not throw on error.
Allows the component to bind events and execute them only when it is enabled.
Contains the state of options for different components. Mainly used by ResultLink.
Contains the state of different components (enabled vs disabled). Allows to get/set values. Triggers component state event when modified. Each component can listen to those events.
A disabled component will not participate in the query, or listen to ComponentEvents.
Allows component to log in the dev console.
Contains the singleton that allows to trigger queries.
Contains the state of the query. Allows to get/set values. Trigger query state event when modified. Each component can listen to those events.
A reference to the root HTMLElement (the SearchInterface).
A reference to the root of every component, the SearchInterface.
The static ID that each component needs in order to be identified.
For example, SearchButton -> static ID: SearchButton -> className: CoveoSearchButton
A reference to the Analytics.client.
Whether to show a button to clear all selected values.
data-enable-clear-button='true' data-enable-clear-button='false'
Specifies the field whose values the SimpleFilter
should output result filters from.
Specifying a value for this option is required for the SimpleFilter
component to work.
data-field='@foo'
Specifies the maximum number of field values to display in the SimpleFilter
dropdown menu.
Default value is 5
. Minimum value is 0
.
data-maximum-number-of-values='10'
string? The sort criteria to use.
Default: score
Allowed values:
score
: sort using the score value which is computed from the number of occurrences of a field value, as well as from the position
where query result items having this field value appear in the ranked query result set. When using this sort criterion, a field value
with 100 occurrences might appear after one with only 10 occurrences, if the occurrences of the latter field value tend to appear higher
in the ranked query result set.
occurrences
: sort by number of occurrences, with field values having the highest number of occurrences appearing first.
alphaascending/alphadescending
: sort alphabetically on the field values.
chisquare
: sort based on the relative frequency of field values in the query result set compared to their frequency in the entire index. This means that a field value that does
not appear often in the index, but does appear often in the query result set will tend to appear higher.
Specifies the title to display for the SimpleFilter
.
Default value is the localized string for NoTitle
.
data-title='foo'
Specifies a JSON object describing a mapping of SimpleFilter
values to their desired captions.
Examples:
`
javascript
var myValueCaptions = {
"txt" : "Text files",
"html" : "Web page",
[ ... ]
};Coveo.init(document.querySelector("#search"), { SimpleFilter : { valueCaption : myValueCaptions } });
* Or before the `init` call, using the <a href="simplefilter.html#options">'options'</a> top-level function:
```javascript
Coveo.options(document.querySelector("#search"), {
SimpleFilter : {
valueCaption : myValueCaptions
}
});
<!-- Ensure that the double quotes are properly handled in `data-value-caption`. -->
<div class='CoveoSimpleFilter' data-field='@myotherfield' data-value-caption='{"txt":"Text files","html":"Web page"}'></div>
Specifies a static list of field values to display in the SimpleFilter
dropdown menu.
This option is undefined by default, which means that the component generates a dynamic list of field values
by performing a GroupByRequest
operation at the same time as the main query.
Creates a new SimpleFilter
component. Binds multiple query events as well.
the HTMLElement on which to instantiate the component.
The options for the SimpleFilter
component.
The bindings that the component requires to function normally.
The
SimpleFilter
component displays a dropdown menu containing field values which the end user can select to filter the query results.The list of available field values in the dropdown menu can either be static (defined through the
values
option), or dynamic (automatically obtained through aGroupByRequest
operation performed at the same time as the main query).November 2017 Release (v2.3477.9)