Mappedin JS - v6.14.0
    Preparing search index...

    Interface Search

    Search allows users to search for locations, categories, and other points of interest within the venue.

    Refer to the Search Guide for more information and interactive examples.

    interface Search {
        enabled: boolean;
        enable(): Promise<void>;
        query(
            term: string,
            options?: {
                enterpriseCategories?: {
                    fields?: {
                        description?: boolean;
                        "locations.name"?: boolean;
                        name?: boolean;
                    };
                    limit?: number;
                };
                enterpriseLocations?: {
                    fields?: { description?: boolean; name?: boolean; tags?: boolean };
                    limit?: number;
                };
                places?: {
                    fields?: { description?: boolean; name?: boolean };
                    limit?: number;
                };
            },
        ): Promise<SearchResult>;
        suggest(
            term: string,
            options?: {
                enterpriseLocations?: { enabled?: boolean };
                places?: { enabled?: boolean };
            },
        ): Promise<Suggestion[]>;
    }
    Index

    Properties

    Methods

    Properties

    enabled: boolean = false

    Whether the search is enabled.

    false
    

    Methods

    • Use query to search for locations based on a string input:

      • EnterpriseLocation: Specific places such as stores, restaurants, or washrooms.
      • EnterpriseCategory: Groups of locations, such as "Food Court" or "Electronics."
      • Places: Any main objects that can be searched for such as Space, Door, Point of Interest

      Search query returns a list of matching {@ link SearchResult} based on the input string.

      SearchResult include information about the type of match, the score (relevance), and detailed metadata about the matching items.

      Parameters

      • term: string

        The search term.

      • options: {
            enterpriseCategories?: {
                fields?: {
                    description?: boolean;
                    "locations.name"?: boolean;
                    name?: boolean;
                };
                limit?: number;
            };
            enterpriseLocations?: {
                fields?: { description?: boolean; name?: boolean; tags?: boolean };
                limit?: number;
            };
            places?: {
                fields?: { description?: boolean; name?: boolean };
                limit?: number;
            };
        } = {}

        The search options.

        • OptionalenterpriseCategories?: {
              fields?: {
                  description?: boolean;
                  "locations.name"?: boolean;
                  name?: boolean;
              };
              limit?: number;
          }

          Options for searching categories.

          • Optionalfields?: { description?: boolean; "locations.name"?: boolean; name?: boolean }

            Fields to search in categories.

            • Optionaldescription?: boolean

              Enable searching by category description

            • Optionallocations.name?: boolean

              Enable searching by names of locations within the category

            • Optionalname?: boolean

              Enable searching by category name

          • Optionallimit?: number

            Maximum number of category results to return

        • OptionalenterpriseLocations?: {
              fields?: { description?: boolean; name?: boolean; tags?: boolean };
              limit?: number;
          }

          Options for searching locations.

          • Optionalfields?: { description?: boolean; name?: boolean; tags?: boolean }

            Fields to search in locations.

            • Optionaldescription?: boolean

              Enable searching by location description

            • Optionalname?: boolean

              Enable searching by location name

            • Optionaltags?: boolean

              Enable searching by location tags

          • Optionallimit?: number

            Maximum number of location results to return

        • Optionalplaces?: { fields?: { description?: boolean; name?: boolean }; limit?: number }

          Options for searching places.

          • Optionalfields?: { description?: boolean; name?: boolean }

            Fields to search in places.

            • Optionaldescription?: boolean

              Enable searching by place description

            • Optionalname?: boolean

              Enable searching by place name

          • Optionallimit?: number

            Maximum number of place results to return

      Returns Promise<SearchResult>

      The search results.

      const results = await search.query('Coffee Shop');
      console.log(results.locations);
    • Suggests the names of places, locations, and categories based on partial input. This is useful for creating an autocomplete feature for a search bar.

      Parameters

      • term: string

        The search term.

      • options: { enterpriseLocations?: { enabled?: boolean }; places?: { enabled?: boolean } } = {}

        The suggest options.

        • OptionalenterpriseLocations?: { enabled?: boolean }

          Options for searching locations.

          • Optionalenabled?: boolean

            Enable searching by location name

        • Optionalplaces?: { enabled?: boolean }

          Options for searching places.

          • Optionalenabled?: boolean

            Enable searching by place name

      Returns Promise<Suggestion[]>

      The search suggestions.

      const suggestions = await search.suggest('Coffee');
      console.log(suggestions);