Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Page

This class represents a search engine results page (SERP).

Hierarchy

  • Page

Index

Constructors

constructor

  • The constructor gets called after SmartSearch receives search results from the backend.

    Parameters

    Returns Page

Properties

facets

facets: Facet[]

An array containing the facets for the search results.

paginationParams

paginationParams: PaginationParams

The pagination options that are used for this page.

searchResults

searchResults: SearchResult[]

An array containing all the search results for this page.

Accessors

didYouMean

  • get didYouMean(): string[]
  • Returns alternative search queries if the numberOfResults value is beneath the threshold configured at the prepared search in the cockpit.

    Returns string[]

fetchClient

numberOfResults

  • get numberOfResults(): number
  • The total number of search results matching the search term.

    Returns number

Methods

addOrUpdateFacetParams

  • Adds or updates all facet parameters in the given list and returns a new list containing the selected values of all facets on this page.

    Parameters

    Returns URLParamList

getFacet

  • getFacet(name: string): Facet | null
  • Parameters

    • name: string

      The name of the facet as it is displayed in the SmartSearch cockpit under Prepared Search > Facet

    Returns Facet | null

    the facet matching the given name if it exists on this prepared search.

getFirstPage

  • getFirstPage(): Promise<Page>
  • This function doesn't work with DynamicPaginationParams.

    Returns Promise<Page>

    The first page with the defined pagination options.

getLastPage

  • getLastPage(): Promise<Page>
  • This function doesn't work with DynamicPaginationParams.

    Returns Promise<Page>

    The last page with the defined pagination options.

getNumberOfPages

  • getNumberOfPages(): number
  • Returns number

    The total number of pages.

getPage

  • getPage(pageNumber: number): Promise<Page>
  • This function doesn't work with DynamicPaginationParams.

    Parameters

    • pageNumber: number

    Returns Promise<Page>

    The specified page with the defined pagination options.

hasNext

  • hasNext(): boolean
  • Checks whether the next function would send a valid request.

    This function is used internally by the next function.

    Returns boolean

hasPage

  • hasPage(pageNumber: number): boolean
  • Checks whether the page with the given page number exists.

    This function is used internally by the getPage function.

    Parameters

    • pageNumber: number

    Returns boolean

hasPrev

  • hasPrev(): boolean
  • Checks whether the prev function would send a valid request.

    This function is used internally by the prev function.

    Returns boolean

isDynamicPagination

  • isDynamicPagination(params: PaginationParams): params is DynamicPaginationParams
  • Parameters

    Returns params is DynamicPaginationParams

isStaticPagination

  • isStaticPagination(params: PaginationParams): params is StaticPaginationParams
  • Parameters

    Returns params is StaticPaginationParams

next

  • next(): Promise<Page>
  • The API response contains the next matches based on the previously set pagination parameters.

    Returns Promise<Page>

    The Page containing all the search results for that page.

prev

  • prev(): Promise<Page>
  • The API response contains the previous matches based on the previously set pagination parameters.

    Returns Promise<Page>

    The Page containing all the search results for that page.

resetFacets

  • resetFacets(include?: string[]): Promise<Page>
  • Resets all facets on this page

    Parameters

    • Optional include: string[]

      An optional list of facet names to reset. If you pass this parameter only the facets that match the names in this list will be resetted. If you pass no parameter, all facets will be resetted.

    Returns Promise<Page>

    The first page of the new and unfiltered resultset.

Generated using TypeDoc