Flarum (v2.0.0-beta.6)
    Preparing search index...

    The SearchSource interface defines a tab of search results in the search modal.

    Search sources should be registered with the GlobalSearch component class by extending the sourceItems method. When the user types a query, each search source will be prompted to load search results via the search method. When the search modal's dropdown is redrawn, it will be constructed by putting together the output from the view method of each source.

    interface GlobalSearchSource {
        resource: string;
        customGrouping(): boolean;
        fullPage(query: string): Vnode<{}, {}> | null;
        gotoItem(id: string): string | null;
        isCached(query: string): boolean;
        search(query: string, limit: number): Promise<void>;
        title(): string;
        view(query: string): Vnode<{}, {}>[];
    }

    Hierarchy (View Summary)

    Index

    Properties

    resource: string

    The resource type that this search source is responsible for.

    Methods

    • Get an array of virtual

    • s that list the search results for the given query.

    Parameters

    Returns Vnode<{}, {}>[]