prorm API Reference
    Preparing search index...

    Class OpenSearchStore

    OpenSearchStore wraps the official @opensearch-project/opensearch client and exposes index management, document CRUD (single + bulk), and Query-DSL search as a typed, promise-based API.

    Implements

    Index
    name: "opensearch" = 'opensearch'

    The name of the store (e.g. 'mongodb', 'redis', 'dynamodb')

    library: "@opensearch-project/opensearch" = '@opensearch-project/opensearch'

    The client library being used

    • Create an index, optionally with a body (mappings/settings/aliases).

      Parameters

      • index: string
      • Optionalbody: Record<string, unknown>

      Returns Promise<void>

    • Delete an index.

      Parameters

      • index: string

      Returns Promise<void>

    • Whether an index exists.

      Parameters

      • index: string

      Returns Promise<boolean>

    • Index (create or overwrite) a document under an explicit id.

      Parameters

      • index: string
      • id: string
      • body: Record<string, unknown>

      Returns Promise<Record<string, unknown>>

    • Get a document's _source by ID.

      Type Parameters

      • T = Record<string, unknown>

      Parameters

      • index: string
      • id: string

      Returns Promise<T | undefined>

    • Run a Query-DSL search and return the hits object from the response.

      Type Parameters

      • T = Record<string, unknown>

      Parameters

      • index: string
      • query: Record<string, unknown>

      Returns Promise<T>

    • Delete a document by ID.

      Parameters

      • index: string
      • id: string

      Returns Promise<Record<string, unknown>>

    • Run a batch of operations (already in the driver's NDJSON action/source array form) in a single request. The real _bulk API rejects an empty request body outright, so short-circuit zero operations to a trivial no-op result rather than surfacing that as an error.

      Parameters

      • operations: BulkOperation[]

      Returns Promise<BulkResult>