0.1.4 • Published 6 months ago

elastic-tiny-client v0.1.4

Weekly downloads
-
License
-
Repository
github
Last release
6 months ago

Elastic search tiny client

Build Code quality check Build Size NPM downloads

Zero dependency, fetch based tiny elasticsearch client.

Also it work's in browser, node.js and bun 🥳 Probably can be also run in deno, but not tested yet.

Why? Because I needed a elasticsearch client for bun but elasticsearch-js still not works 🥺

Install

yarn add elastic-tiny-client // or bun add elastic-tiny-client

Simple usage

import { ElasticClient } from 'elastic-tiny-client'
const client = new ElasticClient({ hosts: ['http://localhost:9200'] })


const indexResult = await client.index({
  index: 'my-index',
  body: {
    title: 'test',
  },
})

const result = await client.search({
  index: 'my-index',
  body: {
    query: {
      match: {
        title: 'test',
      },
    },
  },
})


const deleteResult = await client.delete({
  index: 'my-index',
  id: indexResult.body._id,
})

Basic api are taken from elasticsearch-rest-api-docs. There are still some parts missing, so PR's are welcome 😎.

0.1.4

6 months ago

0.1.2

9 months ago

0.1.3

9 months ago

0.1.0

10 months ago

0.1.1

10 months ago

0.0.9

11 months ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago