Skip to content

Commit

Permalink
Merge pull request #103 from danpaz/prerelease-bodybuilder-2
Browse files Browse the repository at this point in the history
Release bodybuilder 2
  • Loading branch information
danpaz authored Feb 1, 2017
2 parents 5fa26ed + 64bf043 commit ce93fe0
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 423 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@ elasticsearch with a simple, predictable api.

![bodybuilder](img/bodybuilder.jpeg)

**Check out the [API documentation](http://bodybuilder.js.org/docs).**
**Check out the [API reference documentation](http://bodybuilder.js.org/docs).**

## Upgrading to bodybuilder 2

See the [migration guide](./docs/migrate-to-2.md) if you are upgrading from
bodybuilder 1 to bodybuilder 2.

The bodybuilder 1 API documentation is [still available for reference](./docs/API.md).

## Elasticsearch compatibility

Currently aims to support the full elasticsearch query DSL for versions 1.x,
Expand All @@ -36,7 +38,7 @@ body.build() // Build 2.x / 5.x DSL (default)
body.build('v1') // Build 1.x DSL
```

For each elasticsearch query body, create an instance of `Bodybuilder`, apply
For each elasticsearch query body, create an instance of `bodybuilder`, apply
the desired query/filter/aggregation clauses, and call `build` to retrieve the
built query body.

Expand All @@ -46,7 +48,7 @@ Try it out on the command line using the node REPL:

# Start the repl
node ./node_modules/bodybuilder/repl.js
# The builder is available in the context variable Bodybuilder
# The builder is available in the context variable bodybuilder
bodybuilder > bodybuilder().query('match', 'message', 'this is a test').build()

### Queries
Expand Down
2 changes: 1 addition & 1 deletion browser/bodybuilder.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion browser/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ <h3>Open the console to try it out!</h3>
<script>
console.log(
'Try it:',
'var body = new Bodybuilder().query("match", "message", "this is a test").build()'
'var body = bodybuilder().query("match", "message", "this is a test").build()'
)
</script>
</body>
Expand Down
4 changes: 2 additions & 2 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html>
<head>
<meta charset='utf-8' />
<title>Bodybuilder | Documentation</title>
<title>bodybuilder | Documentation</title>
<meta name='viewport' content='width=device-width,initial-scale=1'>
<link href='assets/bass.css' type='text/css' rel='stylesheet' />
<link href='assets/style.css' type='text/css' rel='stylesheet' />
Expand All @@ -13,7 +13,7 @@
<div class='clearfix md-mxn2'>
<div class='fixed xs-hide fix-3 overflow-auto max-height-100'>
<div class='py1 px2'>
<h3 class='mb0 no-anchor'>Bodybuilder</h3>
<h3 class='mb0 no-anchor'>bodybuilder</h3>
<div class='mb1'><code></code></div>
<input
placeholder='Filter'
Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ <h2 class="bb_h2">
}

inputEditor.on('change', onInputChange);
inputEditor.setValue(`new Bodybuilder()
inputEditor.setValue(`bodybuilder()
.query('match', 'message', 'this is a test')
.filter('term', 'user', 'kimchy')
.filter('term', 'user', 'herald')
Expand Down
245 changes: 0 additions & 245 deletions lib/index.js

This file was deleted.

Loading

0 comments on commit ce93fe0

Please sign in to comment.