Class Elastic6Instance

class: Elastic6Instance

  • default agent to handle search.

Hierarchy

Constructors

Properties

client?: Client

Elasticsearch client

elastic?: Elastic6Service<any>

Elastic6Service instance

Elastic6QueryService instance

synchronizer?: Elastic6Synchronizer

Elastic6Synchronizer instance

Accessors

  • get $X(): { createHttpSearchProxy: ((endpoint: string, options?: { credentials?: Credentials; encoder?: ((name: string, path: string) => string); headers?: APIHeaders; name?: string; region?: string; relayHeaderKey?: string; resultKey?: string }) => ApiHttpProxy); describeEndpointUrl: ((url: string, options?: { errScope?: string; throwable?: boolean }) => { host: string; isProxy: boolean; isTunnel: boolean; port: number; protocol: string; region: string }); loadCredentials: ((profile?: string) => Credentials) }
  • expose the internal helpers. (ONLY for debugging)

    Returns { createHttpSearchProxy: ((endpoint: string, options?: { credentials?: Credentials; encoder?: ((name: string, path: string) => string); headers?: APIHeaders; name?: string; region?: string; relayHeaderKey?: string; resultKey?: string }) => ApiHttpProxy); describeEndpointUrl: ((url: string, options?: { errScope?: string; throwable?: boolean }) => { host: string; isProxy: boolean; isTunnel: boolean; port: number; protocol: string; region: string }); loadCredentials: ((profile?: string) => Credentials) }

    • createHttpSearchProxy: ((endpoint: string, options?: { credentials?: Credentials; encoder?: ((name: string, path: string) => string); headers?: APIHeaders; name?: string; region?: string; relayHeaderKey?: string; resultKey?: string }) => ApiHttpProxy)
        • (endpoint: string, options?: { credentials?: Credentials; encoder?: ((name: string, path: string) => string); headers?: APIHeaders; name?: string; region?: string; relayHeaderKey?: string; resultKey?: string }): ApiHttpProxy
        • create http-web-proxy agent which using endpoint as proxy server.

          • originally refer to createHttpWebProxy()

          as cases.

          as proxy agent: GET /<host?>/<path?> as direct agent: GET /<id?>/<cmd?>

          Parameters

          • endpoint: string

            service url (ex: https://xyz.execute-api.~/dev/search/0/proxy)

          • Optional options: { credentials?: Credentials; encoder?: ((name: string, path: string) => string); headers?: APIHeaders; name?: string; region?: string; relayHeaderKey?: string; resultKey?: string }

            optionals parameters.

            • Optional credentials?: Credentials

              credentials to load

            • Optional encoder?: ((name: string, path: string) => string)
                • (name: string, path: string): string
                • path encoder (default encodeURIComponent)

                  Parameters

                  • name: string
                  • path: string

                  Returns string

            • Optional headers?: APIHeaders

              headers

            • Optional name?: string

              client-name (default env.NAME)

            • Optional region?: string

              region

            • Optional relayHeaderKey?: string

              relay-key in headers for proxy.

            • Optional resultKey?: string

              resultKey in response

          Returns ApiHttpProxy

    • describeEndpointUrl: ((url: string, options?: { errScope?: string; throwable?: boolean }) => { host: string; isProxy: boolean; isTunnel: boolean; port: number; protocol: string; region: string })
        • (url: string, options?: { errScope?: string; throwable?: boolean }): { host: string; isProxy: boolean; isTunnel: boolean; port: number; protocol: string; region: string }
        • describe (or parse) the endpoint url

          • it detects if endpoint is the proxied search.
          • it detects if endpoint needs the tunneling.

          Parameters

          • url: string
          • Optional options: { errScope?: string; throwable?: boolean }
            • Optional errScope?: string
            • Optional throwable?: boolean

          Returns { host: string; isProxy: boolean; isTunnel: boolean; port: number; protocol: string; region: string }

          • host: string
          • isProxy: boolean
          • isTunnel: boolean
          • port: number
          • protocol: string
          • region: string
    • loadCredentials: ((profile?: string) => Credentials)
        • (profile?: string): Credentials
        • load the local credential

          • throws if not found.

          Parameters

          • Optional profile: string

            (optional) target profile (default use loadProfile(), '' use the default);

          Returns Credentials

Methods

  • create async generator that yields items queried until last

    Type Parameters

    • T

    Parameters

    • body: any

      Elasticsearch Query DSL

    • Optional searchType: "query_then_fetch" | "dfs_query_then_fetch"

      see 'search_type' in Elasticsearch documentation

    Returns AsyncGenerator<T[], void, unknown>

Generated using TypeDoc