Skip to content

Latest commit

 

History

History
42 lines (27 loc) · 1.06 KB

elasticsearch_client.md

File metadata and controls

42 lines (27 loc) · 1.06 KB

ElasticsearchClient

Communicate with AWS Elasticsearch or Open Search.

Overview

Other solutions for communicating with Elasticsearch are either incompatible with AWS, very heavy weight, or both. This client gets the job done and is as simple as it gets!

  • Simple Promise or async syntax
  • Authenticates to AWS via AWS Signature v4
  • Light-weight

Use it with Elasticsearch's Document API.

ElasticsearchClient depends on two other utilities to work:

Install

npm install @sailplane/elasticsearch-client @sailplane/aws-https @sailplane/logger

Typescript Declarations

elasticsearch-client.d.ts

Examples

Simple example:

function get(id: string): Promise<Ticket> {
    return this.es.request('GET', '/ticket/local/' + id)
        .then((esDoc: ElasticsearchResult) => esDoc._source as Ticket);
}

See examples for a comprehensive example.