1.0.12 • Published 1 year ago

@convergence-finance/elasticsearch-builder v1.0.12

Weekly downloads
12
License
MIT
Repository
github
Last release
1 year ago

ElasticSearch Builder

A TypeScript builder for ElasticSearch (search body, index creation, etc.).

:warning: IN DEVELOPMENT, DO NOT USE IN PRODUCTION :warning:

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.

Installation

npm i @convergence-finance/elasticsearch-builder

Examples

Search Query Body

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
                    }
                }
            ]
        }
    }
}

Tests

npm run test

License

This project is open-sourced software licensed under the MIT license.

1.0.13

1 year ago

1.0.12

3 years ago

1.0.11

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.10

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago