Options
All
  • Public
  • Public/Protected
  • All
Menu

The Find service queries the search-engine for search-matches for the given query.

It is normally used indirectly via the SearchClient class.

Hierarchy

Index

Constructors

constructor

  • new Find(settings: string | IFindSettings, auth?: AuthToken, fetchMethod?: (input: RequestInfo, init?: RequestInit) => Promise<Response>): Find
  • Creates a Find instance that handles fetching matches dependent on settings and query.

    Parameters

    • settings: string | IFindSettings

      The settings that define how the Find instance is to operate.

    • Optional auth: AuthToken

      An auth-object that handles the authentication.

    • Optional fetchMethod: (input: RequestInfo, init?: RequestInit) => Promise<Response>
        • (input: RequestInfo, init?: RequestInit): Promise<Response>
        • Parameters

          • input: RequestInfo
          • Optional init: RequestInit

          Returns Promise<Response>

    Returns Find

Properties

settings

settings: IFindSettings

Accessors

deferUpdateState

  • get deferUpdateState(): boolean
  • Can be used to check the state of deferUpdates.

    Returns boolean

numAborted

  • get numAborted(): number
  • The number of times this service-instance has aborted a request (typically as a result to starting a new request while the previous is still running and needs to be aborted).

    Returns number

numCancelled

  • get numCancelled(): number
  • The number of times this service-instance has cancelled a request (as directed from a user cbRequest rejection).

    Returns number

numCompleted

  • get numCompleted(): number
  • The number of times this service-instance has completed a request (not counting aborted or cancelled requests).

    Returns number

numFailed

  • get numFailed(): number
  • The number of times this service-instance has failed during a request (not counting aborted or cancelled requests).

    Returns number

numRequested

  • get numRequested(): number
  • The number of times this service-instance has started a request.

    Returns number

Methods

categorizationTypeChanged

clientIdChanged

  • clientIdChanged(oldValue: string, query: IQuery): void

dateFromChanged

dateToChanged

deferUpdates

  • deferUpdates(state: boolean, skipPending?: boolean): void
  • Decides whether an update should be executed or not. Typically used to temporarily turn off update-execution. When turned back on the second param can be used to indicate whether pending updates should be executed or not.

    Parameters

    • state: boolean

      Turns on or off deferring of updates.

    • skipPending: boolean = false

      Used to indicate if a pending update is to be executed or skipped when deferring is turned off. The param is ignored for state=true.

    Returns void

fetch

  • fetch(query?: IQuery, suppressCallbacks?: boolean): Promise<IMatches>
  • Fetches the results from the server.

    Parameters

    • Optional query: IQuery

      The query-object that controls which results that are to be returned.

    • Optional suppressCallbacks: boolean

      Set to true if you have defined callbacks, but somehow don't want them to be called.

    Returns Promise<IMatches>

    a promise that when resolved returns the data.

filtersChanged

matchGenerateContentChanged

  • matchGenerateContentChanged(oldValue: boolean, query: IQuery): void

matchGenerateContentHighlightsChanged

  • matchGenerateContentHighlightsChanged(oldValue: boolean, query: IQuery): void

matchGroupingChanged

  • matchGroupingChanged(oldValue: boolean, query: IQuery): void

matchOrderByChanged

matchPageChanged

  • matchPageChanged(oldValue: number, query: IQuery): void

matchPageSizeChanged

  • matchPageSizeChanged(oldValue: number, query: IQuery): void

maxSuggestionsChanged

  • maxSuggestionsChanged(oldValue: number, query: IQuery): void

queryTextChanged

  • queryTextChanged(oldValue: string, query: IQuery): void

requestObject

  • requestObject(includeAuthorizationHeader?: boolean): RequestInit
  • Sets up the Request that is to be executed, with headers and auth as needed.

    Parameters

    • includeAuthorizationHeader: boolean = true

      Set to false to not include the auth jwt token in the request headers. Default=true

    Returns RequestInit

searchTypeChanged

shouldUpdate

  • shouldUpdate(fieldName?: string, query?: IQuery): boolean
  • Parameters

    • Optional fieldName: string
    • Optional query: IQuery

    Returns boolean

uiLanguageCodeChanged

  • uiLanguageCodeChanged(oldValue: string, query: IQuery): void

update

  • update(query: IQuery, delay?: number, useQueryMatchPage?: boolean): void
  • Call the service, but take into account deferredUpdates.

    Parameters

    • query: IQuery

      The query object to create the fetch for.

    • Optional delay: number

      A delay for when to execute the update, in milliseconds. Defaults to undefined.

    • Optional useQueryMatchPage: boolean

      If true then the query match-page number will not be reset to 1. Otherwise it is by default always 1.

    Returns void

Generated using TypeDoc