Class DummyElastic6Service<T>

class: DummyElastic6Service

  • service in-memory dummy data

Type Parameters

Hierarchy

Constructors

Properties

_client: Client
_options: ElasticOption
buffer: { [id: string]: T } = {}

Type declaration

  • [id: string]: T
DECOMPOSED_FIELD: "_decomposed" = '_decomposed'
QWERTY_FIELD: "_qwerty" = '_qwerty'

Accessors

  • get isOldES6(): boolean
  • get isOldES6

    • used when setting doctype
    • used when verifying mismatched error and results of search

    Returns boolean

Methods

  • find the index by name

    Parameters

    • Optional indexName: string

      name of the index

    Returns Promise<{ docsCount: number; docsDeleted: number; health: string; index: string; pri: number; priStoreSize: string; rep: number; status: string; storeSize: string; uuid: string }>

  • create async generator that yields items queried until last

    Parameters

    • body: SearchBody

      Elasticsearch Query DSL that defines the search request (e.g., size, query, filters).

    • Optional params: ElasticSearchAllParams

      parameters including search type, limit, and retry options.

    Returns AsyncGenerator<any[], void, unknown>

  • list of index

    Returns Promise<{ list: { docsCount: number; docsDeleted: number; health: string; index: string; pri: number; priStoreSize: string; rep: number; status: string; storeSize: string; uuid: string }[] }>

  • parse version according to Semantic Versioning (SemVer) rules.

    Returns

    A ParsedVersion object or null if parsing fails and throwable is false.

    Parameters

    • version: string

      The version string to parse (e.g., "1.2.3", "1.2.3-alpha.1", "1.2.3+build.001").

    • Optional options: { throwable?: boolean }

      Optional configuration for throwable behavior.

      • Optional throwable?: boolean

    Returns ParsedVersion

  • search all until limit (-1 means no-limit)

    Type Parameters

    • T

    Parameters

    • body: SearchBody

      Elasticsearch Query DSL that defines the search request (e.g., size, query, filters).

    • Optional params: ElasticSearchAllParams

      parameters including search type, limit, and retry options.

    Returns Promise<T[]>

  • update item (throw if not exist) update table set a=1, b=b+2 where id='a1' 0. no of a1 -> 1,2 (created)

    1. a,b := 10,20 -> 11,22
    2. a,b := 10,null -> 11,2 (upsert)
    3. a,b := null,20 -> 1,22

    Parameters

    • id: string

      item-id

    • updates: T

      item to update

    • Optional increments: Incrementable

      item to increase

    Returns Promise<T>

  • prepare default setting

    • migrated from engine-v2.

    Parameters

    • params: { docType: string; idName: string; replicas?: number; shards?: number; timeSeries?: boolean; version?: string }
      • docType: string
      • idName: string
      • Optional replicas?: number
      • Optional shards?: number
      • Optional timeSeries?: boolean
      • Optional version?: string

    Returns any

Generated using TypeDoc