Provides search capability for one or more data/FeatureSource!FeatureSources.

interface SearchProvider {
    count(source: FeatureSource | FeatureSource[], searchText: string, options?: SearchOptions): Promise<CountResult[]>;
    isSupported(source: FeatureSource): boolean;
    search(source: FeatureSource | FeatureSource[], searchText: string, options?: SearchOptions): AsyncIterable<Feature, any, any>;
    suggest(source: FeatureSource | FeatureSource[], searchText: string, options?: SearchOptions): Promise<SearchSuggestion[]>;
}

Implemented by

Methods

  • Searches a given feature source for features that match a search phrase and returns a count of matching features.

    Parameters

    Returns Promise<CountResult[]>

    An iterator of tasks/CountResult!CountResults containing a count of matching features. If the search is canceled, the provider may reject the returned promise with an instance of support/Cancellable!Cancellation, though it may still fulfill with count results instead.

  • Determines whether this provider can handle searches for the given feature source.

    Parameters

    Returns boolean

  • Searches a given feature source for features that match a search phrase.

    Parameters

    Returns AsyncIterable<Feature, any, any>

    An iterator of data/Feature!Features containing search results. If the search is canceled, the provider may reject the returned promise with an instance of support/Cancellable!Cancellation, though it may still fulfill with search results instead.

  • Suggests matching phrases to search for based on some input text.

    Parameters

    Returns Promise<SearchSuggestion[]>

    A list of suggestions.