# uniql-es

> Produces ElasticSearch queries from UniQL ASTs.

Latest version **0.1.0** (published 2015-02-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install uniql-es
pnpm add uniql-es
yarn add uniql-es
bun add uniql-es
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2015-02-28 |
| First published | 2015-01-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 6 |
| Author | Andy Burke |
| Maintainers | andyburke |
| Keywords | uniql, elasticsearch, elastic, search, query, ast, dsl |

## Links

- npm: https://www.npmjs.com/package/uniql-es
- Repository: https://github.com/honeinc/uniql-es
- Issues: https://github.com/honeinc/uniql-es/issues
- npm.io page: https://npm.io/package/uniql-es

## Dependencies (1)

- [extend](https://npm.io/package/extend.md) ^2.0.0

## Alternatives

- [gamedig](https://npm.io/package/gamedig.md) — 29.3K weekly downloads
- [join-monster](https://npm.io/package/join-monster.md) — 12.8K weekly downloads
- [masked](https://npm.io/package/masked.md) — 5.5K weekly downloads
- [@comunica/actor-query-process-explain-logical](https://npm.io/package/@comunica/actor-query-process-explain-logical.md) — 4.7K weekly downloads
- [@veracity/vui](https://npm.io/package/@veracity/vui.md) — 4.6K weekly downloads

## Recent versions

- 0.1.0 (latest) — 2015-02-28
- 0.0.2 — 2015-01-08

## README

UniQL-ES
=======

This generates ElasticSearch queries based on [UniQL](https://github.com/honeinc/uniql) ASTs.

## Example

```javascript
var parse = require( 'uniql' );
var esCompile = require( 'uniql-es' );

var ast = parse( '( height <= 20 or ( favorites.color == "green" and height != 25 ) ) and firstname ~= "o.+"' );
var esQuery = esCompile( ast );
console.log( util.inspect( esQuery, { depth: null } ) );
```

Resulting query:

```
{ query: 
   { filtered: 
      { filter: 
         [ { bool: 
              { must: 
                 [ { bool: 
                      { should: 
                         [ { range: { height: { lte: 20 } } },
                           { bool: 
                              { must: 
                                 [ { term: { 'favorites.color': 'green' } },
                                   { bool: { must_not: { term: { height: 25 } } } } ] } } ] } },
                   { bool: { must: { regexp: { firstname: 'o.+' } } } } ] } } ] } } }
```

## License

[MIT](LICENSE)

---
_Source: https://npm.io/package/uniql-es · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
