<commit_before># elastorm
Handy APIs for elastic search querying<commit_msg>read me<commit_after># elastorm
Handy APIs for elastic search querying. Useful if you want to get rid of elasticsearch complicated json query.

#### Installation

```
$ npm install elastorm
```

#### How to use
```
var estorm = require('elastorm');
```
#### Create a builder object
```
var buider = estorm({
    index: //name of index,
    limit: //number of rows that returned,
    offset: //offset,
    elastic: {
        host: //IP address,
        sniffOnStart: //[true/false],
        sniffInterval: //[true/false],
    }
});
```
#### APIs
##### .query(string, fields, default_operator)
Used to build the query string.
```
buider.query('*firstname:Micheal lastname:Jackson*', ['firstname', 'lastname'], 'AND')
```
{'fraction_non_alphanumeric': 0.15994962216624686, 'fraction_numerical': 0.0, 'mean_word_length': 3.8181818181818183, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2384236', 'n_tokens_mistral': 259, 'n_tokens_neox': 240, 'n_words': 80}