Options
All
  • Public
  • Public/Protected
  • All
Menu

Representation of a search response from a specific invocation of a SearchProvider's onSearch listener function. Can optionally be used to push search results to the requester.

function onSearch(searchListenerRequest, searchListenerResponse) {
   searchListenerResponse.open();

   const myLongRunningQuery = makeMyLongRunningQuery(searchListenerRequest.query);
   myLongRunningQuery.onNewResults(myNewResults => {
      searchListenerResponse.respond(myNewResults);
   });

   searchListenerRequest.onClose(() => {
      myLongRunningQuery.close();
   });
}

Hierarchy

  • SearchListenerResponse

Index

Methods

close

  • close(): void
  • Close the response stream. This notifies the requester that the current search provider is done sending results.

    experimental

    Returns void

open

  • open(): void
  • Open the response stream, notifying the search requester that there are new or updated search results that have yet to be pushed by the current provider.

    experimental

    Returns void

respond

  • Respond to the search request with new or updated search results.

    experimental

    Parameters

    • results: SearchResult[]

      new or updated search results to respond with.

    Returns void

revoke

  • revoke(...resultKeys: string[]): void
  • Remove a search result from the list of responded search results.

    experimental

    Parameters

    • Rest ...resultKeys: string[]

      the keys of the search results to revoke.

    Returns void

Legend

  • Property
  • Method

Generated using TypeDoc