Class AjaxSolr.AbstractFacetWidget
Extends
AjaxSolr.AbstractWidget.
AbstractFacetWidget
Defined in: AbstractFacetWidget.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Baseclass for all facet widgets.
|
Method Attributes | Method Name and Description |
---|---|
add(value)
Adds a filter query.
|
|
An abstract hook for child implementations.
|
|
changeSelection(Selection)
Helper for selection functions.
|
|
clear()
Removes all filter queries using the widget's facet field.
|
|
clickHandler(value)
|
|
constructor(attributes)
|
|
fq(value, exclude)
|
|
One of "facet.field", "facet.date" or "facet.range" must be set on the
widget in order to determine where the facet counts are stored.
|
|
getFacetCountsArrarr(property)
Used if the facet counts are represented as an array of two-element arrays.
|
|
getFacetCountsFlat(property)
Used if the facet counts are represented as a flat array.
|
|
getFacetCountsMap(property)
Used if the facet counts are represented as a JSON object.
|
|
init()
|
|
Add facet parameters to the parameter store.
|
|
isEmpty()
|
|
remove(value)
Removes a filter query.
|
|
set(value)
Sets the filter query.
|
|
unclickHandler(value)
|
- Methods borrowed from class AjaxSolr.AbstractWidget:
- afterRequest, beforeRequest, doRequest
Method Detail
{Boolean}
add(value)
Adds a filter query.
- Parameters:
- value
- Returns:
- {Boolean} Whether a filter query was added.
afterChangeSelection()
An abstract hook for child implementations.
This method is executed after the filter queries change.
{Boolean}
changeSelection(Selection)
Helper for selection functions.
- Parameters:
- {Function} Selection
- function to call.
- Returns:
- {Boolean} Whether the selection changed.
{Boolean}
clear()
Removes all filter queries using the widget's facet field.
- Returns:
- {Boolean} Whether a filter query was removed.
{Function}
clickHandler(value)
- Parameters:
- {String} value
- The value.
- Returns:
- {Function} Sends a request to Solr if it successfully adds a filter query with the given value.
constructor(attributes)
- Parameters:
- {Object} attributes
- {String} attributes.field
- The field to facet on.
- {Number} attributes.start Optional
- This widget will by default set the offset parameter to 0 on each request.
- {Boolean} attributes.multivalue Optional
- Set to false to force a single "fq" parameter for this widget. Defaults to true.
{String}
fq(value, exclude)
- Parameters:
- {String} value
- The facet value.
- {Boolean} exclude
- Whether to exclude this fq parameter value.
- Returns:
- {String} An fq parameter value.
{Array}
getFacetCounts()
One of "facet.field", "facet.date" or "facet.range" must be set on the
widget in order to determine where the facet counts are stored.
- Returns:
- {Array} An array of objects with the properties facet and count, e.g { facet: 'facet', count: 1 }.
{Array}
getFacetCountsArrarr(property)
Used if the facet counts are represented as an array of two-element arrays.
- Parameters:
- {String} property
- "facet_fields", "facet_dates", or "facet_ranges".
- Returns:
- {Array} An array of objects with the properties facet and count, e.g { facet: 'facet', count: 1 }.
{Array}
getFacetCountsFlat(property)
Used if the facet counts are represented as a flat array.
- Parameters:
- {String} property
- "facet_fields", "facet_dates", or "facet_ranges".
- Returns:
- {Array} An array of objects with the properties facet and count, e.g { facet: 'facet', count: 1 }.
{Array}
getFacetCountsMap(property)
Used if the facet counts are represented as a JSON object.
- Parameters:
- {String} property
- "facet_fields", "facet_dates", or "facet_ranges".
- Returns:
- {Array} An array of objects with the properties facet and count, e.g { facet: 'facet', count: 1 }.
init()
initStore()
Add facet parameters to the parameter store.
{Boolean}
isEmpty()
- Returns:
- {Boolean} Whether any filter queries have been set using this widget's facet field.
{Boolean}
remove(value)
Removes a filter query.
- Parameters:
- value
- Returns:
- {Boolean} Whether a filter query was removed.
{Boolean}
set(value)
Sets the filter query.
- Parameters:
- value
- Returns:
- {Boolean} Whether the selection changed.
{Function}
unclickHandler(value)
- Parameters:
- {String} value
- The value.
- Returns:
- {Function} Sends a request to Solr if it successfully removes a filter query with the given value.