Class FilteredSearch

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

Instances of this class respresent search pages with filters and/or modifiers (such as sorting).

Hierarchy

Constructors

Properties

_activeModifier?: Query
_filters: Filter[] = []
_modifiers?: Query[]
emptyParameterQuery?: Query
modifiers?: Query[]
searchQuery: Query

Accessors

Methods

  • Add a facet to the FilteredSearch object.

    Parameters

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

    Returns void

  • Add a filter to the FilteredSearch object.

    Parameters

    • obj: Query | Filter

      the Filter to be added or a Query object, from which a SimpleFilter or ParameterizedFilter will be deduced

    Returns void

  • Parameters

    • filterEndpoint: string
    • resetOnQueryChange: boolean = true
    • filterParameterName: string = 'value'

    Returns void

  • Parameters

    • filterEndpoint: string

    Returns void

  • Clear the selection for all or a given filter.

    Parameters

    • Optional endpoint: string

    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 filter or facet.

    Parameters

    • endpoint: string
    • selection: undefined | null | string | number | (string | number)[] | (string | number)[][]

    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

  • Overwrite the entire state with the values in the passed Query stack.

    Parameters

    • results: Query[]

      typically retrieved from a URL query parameter and then parsed with parseQueries

    Returns void

Generated using TypeDoc