Member Junction
    Preparing search index...

    Class BaseSearchProviderAbstract

    Abstract base class for search providers. Subclasses must be registered with @RegisterClass(BaseSearchProvider, 'DriverClassName') to be discoverable by the SearchEngine.

    Lifecycle:

    1. SearchEngine loads active SearchProvider records from the database
    2. For each record, ClassFactory creates an instance using DriverClass
    3. Initialize() is called with the provider's config from the DB record
    4. CheckAvailability() is called to verify the provider is operational
    5. If IsAvailable(), the provider participates in searches

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    config: SearchProviderConfig = null

    Config from the SearchProvider metadata record, set during Initialize()

    SourceType: SearchSource

    Which search source this provider represents

    Accessors

    Methods

    • Check and cache whether this provider is operational. Called after Initialize(). Override for providers that need to verify external dependencies (e.g., vector indexes exist, API keys are valid).

      The default implementation returns true (always available).

      Parameters

      • contextUser: UserInfo

        The user context for availability checks

      Returns Promise<void>

    • Initialize the provider with configuration from the SearchProvider entity. Called once during SearchEngine.Config(). Override to perform provider-specific setup (e.g., connecting to external APIs using credentials).

      Parameters

      Returns Promise<void>

    • Execute a search and return result items with scores.

      When scopeConstraints is provided, the provider MUST:

      1. Narrow its retrieval surface to match the constraint (e.g., VectorSearchProvider queries only the listed ExternalIndexes with matching IndexType, EntitySearchProvider queries only the listed Entities, StorageSearchProvider queries only the listed accounts/folders, 3rd-party providers filter by their own IndexType).
      2. Apply any rendered MetadataFilter / ExtraFilter / UserSearchString / FolderPath values as native filters.
      3. Implement permission push-down (see Section 3.6 of plans/search-scopes-rag-plus.md) — never surface results the contextUser cannot see.
      4. Honor scopeConstraints.QueryTransforms when a per-provider rewrite is supplied — look up by your SourceType or provider-specific key and use that string in place of the raw query.

      When scopeConstraints is undefined, the provider runs unconstrained (backward compatible pre-scope behavior).

      Parameters

      • query: string

        The search query text

      • topK: number

        Maximum number of results to retrieve

      • filters: SearchFilters

        Optional filters to narrow results

      • contextUser: UserInfo

        The user performing the search

      • OptionalscopeConstraints: ScopeConstraints

        Optional per-scope constraint set, pre-rendered with SearchContext values

      Returns Promise<SearchResultItem[]>

      Scored result items from this provider

    • Enumerate every search provider currently registered with ClassFactory under BaseSearchProvider. Designed for the SearchScope form's provider dropdown (P5.5) — populates the dropdown from this single call rather than hardcoding a list, so any ClassFactory-registered provider (including third-party ones) shows up automatically.

      Each entry includes the driver-class registration key (writes into SearchProvider.DriverClass) and the SourceType the provider implements. Sorted by DriverClass for stable UI ordering.

      Returns RegisteredSearchProviderInfo[]