eggjs elasticsearch plugin use elasticsearch@8
npm install eggjs-elasticsearch
plugin.js
{
elasticsearch: {
enable: true,
package: "eggjs-elasticsearch"
}
}
config.default.ts
single client
{
elasticsearch: {
client: {
node: "http://localhost:9200"
}
}
}
config.default.ts
multi clients
{
elasticsearch: {
clients: {
foo: {
node: "http://localhost:9200"
},
bar: {
node: "http://localhost:9201"
}
}
}
}
more options see @elastic/elasticsearch
https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/index.html