Class FacetedSearch

Associate Query objects with each other in a faceted search setup.

Hierarchy

  • FacetedSearch

Constructors

Properties

_activeModifier?: Query
_facets: Facet[] = []
_modifiers?: Query[]
emptyParameterQuery?: Query
modifiers?: Query[]
searchQuery: Query

Accessors

Methods

  • Add a facet to the FacetedSearch object.

    Parameters

    • endpoint: string
    • type: FacetType = FacetType.single
    • resetOnQueryChange: boolean = true
    • filterEndpointPostfix: string = ':FILTER'
    • filterEndpointParameterName: string = 'value'

    Returns void

  • Clear the selection for a given facet.

    Parameters

    • Optional facetEndpoint: string

    Returns void

  • Clear all searchQuery parameters

    Returns void

  • Get the Query to get the search results. Will return searchQuery as passed to the constructor unless a emptyParameterQuery was also passed and all parameters for searchQuery are empty.

    Returns Query

  • Get the Query objects to retrieve the facet options. When using multiple facets, the facetEndpoint parameter is required.

    Parameters

    • facetEndpoint: string
    • excludeModifier: boolean = false

    Returns Query[]

  • Get the Query objects to retrieve search results. This includes the facet Query, if applicable.

    Parameters

    • excludeModifier: boolean = false

    Returns Query[]

  • Set the selected options for a given facet.

    Parameters

    • facetEndpoint: string
    • selection: string | string[]

    Returns void

  • Set a query as modifier. Only modifiers in the list passed to constructor are allowed.

    Parameters

    • modifier: undefined | Query

    Returns void

  • Set a parameter value for the searchQuery

    Parameters

    • name: string
    • value: string

    Returns void

Generated using TypeDoc