Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Facet

Hierarchy

  • Facet

Index

Constructors

constructor

  • Parameters

    • searchClient: FetchClient

      The fetch client to send the HTTP requests.

    • data: FacetData

      The possible values to filter this searchTerm by.

    • config: FacetConfig

      The facets configured in the prepared search.

    Returns Facet

Properties

config

config: FacetConfig

The facets configured in the prepared search.

data

data: FacetData

The possible values to filter this searchTerm by.

Accessors

counts

  • Returns FacetCount[]

    An array containing the possible values for this facet that can be used in the filter function as well as the number of search results that would be returned if you filtered by value.

displayName

  • get displayName(): string | undefined
  • Returns string | undefined

filterClient

name

  • get name(): string
  • Returns string

selectedValues

  • Returns FacetValue[] | undefined

type

  • get type(): string | undefined
  • Returns string | undefined

Methods

customFilter

  • Filters the search results for this search term using the facet values passed to this function. Allows for the additional usage of custom parameters

    Parameters

    • filterValues: FacetValue[]

      The facet values to be filtered. Must be an array.

    • Rest ...customParams: URLParam[]

      Additional parameter objects. The key will be the parameter name, the value its value. If the parameters already exist (because you added them as configuration options) they will be overwritten and then deleted.

    Returns Promise<Page>

filter

  • Filters the search results for this search term using the facette values passed to this function.

    throws

    When selected values are not allowed or multiple selections are not allowed.

    Parameters

    • Rest ...filterValues: FacetValue[]

      The facet values to be filtered.

    Returns Promise<Page>

getFilterParamName

  • getFilterParamName(): string
  • Returns string

getQueryParam

getSelectedParameters

  • Returns URLParam[]

isValueAllowed

  • Parameters

    Returns boolean

reset

  • Resets all selected values in this facet. For resetting a single facet we recommend calling filter with no parameters instead.

    Returns Facet

    The resetted facet.

setDisplayName

  • setDisplayName(name: string): Facet
  • Parameters

    • name: string

    Returns Facet

setSelectedValues

  • setSelectedValues(...values: string[]): Facet
  • Parameters

    • Rest ...values: string[]

    Returns Facet

Generated using TypeDoc