Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/beace/eggjs-elasticsearch

eggjs elasticsearch plugin
https://github.com/beace/eggjs-elasticsearch

Last synced: 15 days ago
JSON representation

eggjs elasticsearch plugin

Awesome Lists containing this project

README

        

# eggjs-elasticsearch


Version
Downloads

eggjs elasticsearch plugin use elasticsearch@8

## install

```
npm install eggjs-elasticsearch
```

## eggjs plugin config

`plugin.js`

```js
{
elasticsearch: {
enable: true,
package: "eggjs-elasticsearch"
}
}
```

## plugin config

`config.default.ts` single client

```js
{
elasticsearch: {
client: {
node: "http://localhost:9200"
}
}
}

```

`config.default.ts` multi clients

```js
{
elasticsearch: {
clients: {
foo: {
node: "http://localhost:9200"
},
bar: {
node: "http://localhost:9201"
}
}
}
}

```

more options see [@elastic/elasticsearch](https://npmjs.org/@elastic/elasticsearch)

## learn how to use elasticsearch client

https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/index.html