Class Elastic6Service<T>

class: Elastic6Service

  • extends ElasticIndexService and adds version-specific implementation

Type Parameters

Hierarchy

Constructors

Properties

_client: Client
_options: ElasticOption
DECOMPOSED_FIELD: "_decomposed" = '_decomposed'
QWERTY_FIELD: "_qwerty" = '_qwerty'

Accessors

Methods

  • create index by name

    Parameters

    • Optional settings: any

      creating settings

    Returns Promise<{ acknowledged: any; index: string; status: any }>

  • destroy search index

    Returns Promise<{ acknowledged: any; index: string; status: any }>

  • 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

  • Private

    generate autocomplete fields into the item body to be indexed

    Type Parameters

    • T = any

    Parameters

    • body: T

      item body to be saved into ES6 index

    Returns T

  • save info to a JSON file.

    Parameters

    • info: any

      The information to be saved

    • filePath: string

      The file path where should be saved.

    Returns Promise<void>

  • 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

    • item: T

      item to update

    • Optional increments: Incrementable

      item to increase

    • Optional options: { maxRetries?: number }

      (optional) request option of client.

      • Optional maxRetries?: number

    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