A TypeScript builder for ElasticSearch (search body, index creation, etc.).
This project currently does not support all versions of ElasticSearch or contain all the possible variables for building a complete and valid ES JSON output.
npm i @convergence-finance/elasticsearch-builder
import ElasticSearchBuilder from "@convergence-finance/elasticsearch-builder"
const searchBody = ElasticSearchBuilder.instance()
.buildSearchBody()
.query()
.bool()
.mustNot()
.match("isActive", true)
.end()
.mustNot()
.match("status", 10)
.end()
.end()
.end()
.build()
Output of searchBody
:
{
"query": {
"bool": {
"must_not": [
{
"match": {
"isActive": true
}
},
{
"match": {
"status": 10
}
}
]
}
}
}
npm run test
This project is open-sourced software licensed under the MIT license.