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

  • Add a custom query to the search index

    Parameters

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

        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>

  • Returns void

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

    Returns Promise<string>