Class OfflineSearch

A OfflineSearch is an offline search module. It can be initialized at any time by passing the Mappedin object and a set of TMappedinOfflineSearchOptions options.

Hierarchy

  • OfflineSearch

Constructors

Methods

Constructors

Methods

  • Add a custom query to the search index

    Parameters

    • params: {
          object: MappedinLocation | MappedinCategory | Record<string, unknown>;
          query: string;
          weight?: number;
      }
      • object: MappedinLocation | MappedinCategory | Record<string, unknown>

        Object that is returned when query matches

      • query: string

        Query string to match for this object

      • Optional weight?: number

        Optional weight to multiply by the score

    Returns Promise<void>

  • Export search index to JSON for storage/caching - this would avoid having to re-index on page reload

    Returns Promise<string>