es-search-builder

    1.3.1 • Public • Published

    es-search-builder

    Query builder for Elasticsearch

    npm version Codeship Status for stevejay/es-search-builder Coverage Status bitHound Overall Score bitHound Dependencies bitHound Dev Dependencies license

    NPM

    Install

    $ npm install --save es-search-builder
    

    Usage

    SearchBuilder

    const SearchBuilder = require('es-search-builder').SearchBuilder;
     
    const searchBuilder = new SearchBuilder();
    const query = searchBuilder.createQuery();
    const boolQuery = query.createBoolQuery()
        .addFilter()
        .setTerm({ status: 'Active' });
     
    const result = searchBuilder.build();

    MultiSearchBuilder

    const MultiSearchBuilder = require('es-search-builder').MultiSearchBuilder;
     
    const multiSearchBuilder = new MultiSearchBuilder();
    const search = multiSearchBuilder.createSearch({ index: 'some-index' });
    const query = search.createQuery();
    const boolQuery = query.createBoolQuery()
        .addFilter()
        .setTerm({ status: 'Active' });
     
    const result = multiSearchBuilder.build();

    License

    MIT

    Install

    npm i es-search-builder

    DownloadsWeekly Downloads

    3

    Version

    1.3.1

    License

    MIT

    Last publish

    Collaborators

    • middleengine