diff --git a/README.md b/README.md
index 54d5bd3a..c2317c34 100644
--- a/README.md
+++ b/README.md
@@ -46,18 +46,18 @@ npm install elastic-builder --save
## Usage
```js
-const bob = require('elastic-builder'); // the builder
+const esb = require('elastic-builder'); // the builder
-const requestBody = bob.requestBodySearch()
- .query(bob.matchQuery('message', 'this is a test'));
+const requestBody = esb.requestBodySearch()
+ .query(esb.matchQuery('message', 'this is a test'));
// OR
-const requestBody = new bob.RequestBodySearch().query(
- new bob.MatchQuery('message', 'this is a test')
+const requestBody = new esb.RequestBodySearch().query(
+ new esb.MatchQuery('message', 'this is a test')
);
-requestBody.toJSON(); // or print to console - bob.prettyPrint(requestBody)
+requestBody.toJSON(); // or print to console - esb.prettyPrint(requestBody)
{
"query": {
"match": {
@@ -77,8 +77,8 @@ Try it out on the command line using the node REPL:
```
# Start the repl
node ./node_modules/elastic-builder/repl.js
-# The builder is available in the context variable bob
-elastic-builder > bob.prettyPrint(bob.requestBodySearch().query(bob.matchQuery('message', 'this is a test')));
+# The builder is available in the context variable esb
+elastic-builder > esb.prettyPrint(esb.requestBodySearch().query(esb.matchQuery('message', 'this is a test')));
```
## Motivation
@@ -111,7 +111,7 @@ The library has a few helper recipes:
* [Filter query][es-filter-query]
```js
-const qry = bob.cookMissingQuery('user');
+const qry = esb.cookMissingQuery('user');
qry.toJSON();
{
@@ -140,15 +140,15 @@ request][create-pull-request] :smile:.
'use strict';
const elasticsearch = require('elasticsearch');
-const bob = require('elastic-builder');
+const esb = require('elastic-builder');
const client = new elasticsearch.Client({
host: 'localhost:9200',
log: 'trace'
});
-const requestBody = bob.requestBodySearch()
- .query(bob.matchQuery('body', 'elasticsearch'));
+const requestBody = esb.requestBodySearch()
+ .query(esb.matchQuery('body', 'elasticsearch'));
client.search({
index: 'twitter',
@@ -165,10 +165,10 @@ client.search({
```js
// Bool query
-const requestBody = bob.requestBodySearch().query(
- bob.boolQuery()
- .must(bob.matchQuery('last_name', 'smith'))
- .filter(bob.rangeQuery('age').gt(30))
+const requestBody = esb.requestBodySearch().query(
+ esb.boolQuery()
+ .must(esb.matchQuery('last_name', 'smith'))
+ .filter(esb.rangeQuery('age').gt(30))
);
requestBody.toJSON();
{
@@ -185,8 +185,8 @@ requestBody.toJSON();
}
// Multi Match Query
-const requestBody = bob.requestBodySearch().query(
- bob.multiMatchQuery(['title', 'body'], 'Quick brown fox')
+const requestBody = esb.requestBodySearch().query(
+ esb.multiMatchQuery(['title', 'body'], 'Quick brown fox')
.type('best_fields')
.tieBreaker(0.3)
.minimumShouldMatch('30%')
@@ -203,9 +203,9 @@ requestBody.toJSON();
}
// Aggregation
-const requestBody = bob.requestBodySearch()
+const requestBody = esb.requestBodySearch()
.size(0)
- .agg(bob.termsAggregation('popular_colors', 'color'));
+ .agg(esb.termsAggregation('popular_colors', 'color'));
requestBody.toJSON();
{
"size": 0,
@@ -217,12 +217,12 @@ requestBody.toJSON();
}
// Nested Aggregation
-const requestBody = bob.requestBodySearch()
+const requestBody = esb.requestBodySearch()
.size(0)
.agg(
- bob.termsAggregation('colors', 'color')
- .agg(bob.avgAggregation('avg_price', 'price'))
- .agg(bob.termsAggregation('make', 'make'))
+ esb.termsAggregation('colors', 'color')
+ .agg(esb.avgAggregation('avg_price', 'price'))
+ .agg(esb.termsAggregation('make', 'make'))
);
requestBody.toJSON();
{
@@ -243,11 +243,11 @@ requestBody.toJSON();
}
// If you prefer using the `new` keyword
-const agg = new bob.TermsAggregation('countries', 'artist.country')
+const agg = new esb.TermsAggregation('countries', 'artist.country')
.order('rock>playback_stats.avg', 'desc')
.agg(
- new bob.FilterAggregation('rock', new bob.TermQuery('genre', 'rock')).agg(
- new bob.StatsAggregation('playback_stats', 'play_count')
+ new esb.FilterAggregation('rock', new esb.TermQuery('genre', 'rock')).agg(
+ new esb.StatsAggregation('playback_stats', 'play_count')
)
)
.toJSON();
@@ -274,16 +274,16 @@ agg.toJSON();
}
// Sort
-const requestBody = bob.requestBodySearch()
- .query(bob.boolQuery().filter(bob.termQuery('message', 'test')))
- .sort(bob.sort('timestamp', 'desc'))
+const requestBody = esb.requestBodySearch()
+ .query(esb.boolQuery().filter(esb.termQuery('message', 'test')))
+ .sort(esb.sort('timestamp', 'desc'))
.sorts([
- bob.sort('channel', 'desc'),
- bob.sort('categories', 'desc'),
+ esb.sort('channel', 'desc'),
+ esb.sort('categories', 'desc'),
// The order defaults to desc when sorting on the _score,
// and defaults to asc when sorting on anything else.
- bob.sort('content'),
- bob.sort('price').order('desc').mode('avg')
+ esb.sort('content'),
+ esb.sort('price').order('desc').mode('avg')
]);
requestBody.toJSON();
{
@@ -304,8 +304,8 @@ requestBody.toJSON();
}
// From / size
-const requestBody = bob.requestBodySearch()
- .query(bob.matchAllQuery())
+const requestBody = esb.requestBodySearch()
+ .query(esb.matchAllQuery())
.size(5)
.from(10);
requestBody.toJSON();
@@ -324,7 +324,7 @@ For more examples, check out the [reference docs][api-docs].
```
$ node ./node_modules/elastic-builder/repl.js
-elastic-builder > bob.multiMatchQuery().field('title').field('body').query('Quick brown fox').type('bwst_fields')
+elastic-builder > esb.multiMatchQuery().field('title').field('body').query('Quick brown fox').type('bwst_fields')
See https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-multi-match-query.html
Got 'type' - bwst_fields
Error: The 'type' parameter should belong to Set {
diff --git a/docs/intro.md b/docs/intro.md
index 45de3654..50bd12ad 100644
--- a/docs/intro.md
+++ b/docs/intro.md
@@ -16,15 +16,15 @@ There are two ways to use the classes for constructing queries:
```js
// Import the library
-const bob = require('elastic-builder'); // the builder
+const esb = require('elastic-builder'); // the builder
// Use `new` keyword for constructor instances of class
-const requestBody = new bob.RequestBodySearch()
- .query(new bob.MatchQuery('message', 'this is a test'));
+const requestBody = new esb.RequestBodySearch()
+ .query(new esb.MatchQuery('message', 'this is a test'));
// Or use helper methods which construct the object without need for the `new` keyword
-const requestBody = bob.requestBodySearch()
- .query(bob.matchQuery('message', 'this is a test'));
+const requestBody = esb.requestBodySearch()
+ .query(esb.matchQuery('message', 'this is a test'));
// Build the request body
requestBody.toJSON()
@@ -43,7 +43,7 @@ requestBody.toJSON()
But this is not required in node env 6 and above. You can directly use the `src` files:
```js
-const bob = require('elastic-builder/src');
+const esb = require('elastic-builder/src');
```
This module is heavily influenced by [elastic.js](https://github.com/fullscale/elastic.js)(not maintained anymore).
diff --git a/repl.js b/repl.js
index 2b099293..ce920a91 100644
--- a/repl.js
+++ b/repl.js
@@ -2,6 +2,6 @@
const repl = require('repl');
-const bob = require('./lib');
+const esb = require('./lib');
-repl.start('elastic-builder > ').context.bob = bob;
+repl.start('elastic-builder > ').context.esb = esb;
diff --git a/src/README.md b/src/README.md
index bfb646f4..d4e3dc43 100644
--- a/src/README.md
+++ b/src/README.md
@@ -43,7 +43,7 @@ from `elastic-builder/src`. But now I have added the type definition so that adv
Starting from the base folder `src`, `index.js` simply pulls in all the concrete classes and re-exports
them under the same object so that you can access all queries and aggregations. It also adds
-helper methods so that the class, for example `MatchQuery` can be instantiated with `bob.matchQuery()`
+helper methods so that the class, for example `MatchQuery` can be instantiated with `esb.matchQuery()`
thereby avoiding the `new` keyword. This means there are 2 ways of doing the same thing. While this is not ideal,
the reason for doing so because the documentation, type definitions declare classes and
it might be confusing to access them using only functions. I am open to rethinking this approach.
diff --git a/src/aggregations/bucket-aggregations/adjacency-matrix-aggregation.js b/src/aggregations/bucket-aggregations/adjacency-matrix-aggregation.js
index 73a3d8d5..ac5ad0ef 100644
--- a/src/aggregations/bucket-aggregations/adjacency-matrix-aggregation.js
+++ b/src/aggregations/bucket-aggregations/adjacency-matrix-aggregation.js
@@ -16,10 +16,10 @@ const ES_REF_URL =
* [Elasticsearch reference](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-adjacency-matrix-aggregation.html)
*
* @example
- * const agg = bob.adjacencyMatrixAggregation('interactions').filters({
- * grpA: bob.termsQuery('accounts', ['hillary', 'sidney']),
- * grpB: bob.termsQuery('accounts', ['donald', 'mitt']),
- * grpC: bob.termsQuery('accounts', ['vladimir', 'nigel'])
+ * const agg = esb.adjacencyMatrixAggregation('interactions').filters({
+ * grpA: esb.termsQuery('accounts', ['hillary', 'sidney']),
+ * grpB: esb.termsQuery('accounts', ['donald', 'mitt']),
+ * grpC: esb.termsQuery('accounts', ['vladimir', 'nigel'])
* });
*
* @param {string} name The name which will be used to refer to this aggregation.
diff --git a/src/aggregations/bucket-aggregations/bucket-aggregation-base.js b/src/aggregations/bucket-aggregations/bucket-aggregation-base.js
index 61c493d4..a97bdea6 100644
--- a/src/aggregations/bucket-aggregations/bucket-aggregation-base.js
+++ b/src/aggregations/bucket-aggregations/bucket-aggregation-base.js
@@ -44,14 +44,14 @@ class BucketAggregationBase extends Aggregation {
*
* @example
* // Generating the terms using a script
- * const agg = bob.termsAggregation('genres').script(
- * bob.script('file', 'my_script').params({ field: 'genre' })
+ * const agg = esb.termsAggregation('genres').script(
+ * esb.script('file', 'my_script').params({ field: 'genre' })
* );
*
* @example
* // Value script
- * const agg = bob.termsAggregation('genres', 'genre').script(
- * bob.script('inline', "'Genre: ' +_value").lang('painless')
+ * const agg = esb.termsAggregation('genres', 'genre').script(
+ * esb.script('inline', "'Genre: ' +_value").lang('painless')
* );
*
* @param {Script} script
diff --git a/src/aggregations/bucket-aggregations/children-aggregation.js b/src/aggregations/bucket-aggregations/children-aggregation.js
index ea80dd05..515d2ef5 100644
--- a/src/aggregations/bucket-aggregations/children-aggregation.js
+++ b/src/aggregations/bucket-aggregations/children-aggregation.js
@@ -14,15 +14,15 @@ const ES_REF_URL =
* [Elasticsearch reference](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-children-aggregation.html)
*
* @example
- * const reqBody = bob.requestBodySearch()
+ * const reqBody = esb.requestBodySearch()
* .agg(
- * bob.termsAggregation('top-tags', 'tags.keyword')
+ * esb.termsAggregation('top-tags', 'tags.keyword')
* .size(10)
* .agg(
- * bob.childrenAggregation('to-answers')
+ * esb.childrenAggregation('to-answers')
* .type('answer')
* .agg(
- * bob.termsAggregation(
+ * esb.termsAggregation(
* 'top-names',
* 'owner.display_name.keyword'
* ).size(10)
diff --git a/src/aggregations/bucket-aggregations/date-histogram-aggregation.js b/src/aggregations/bucket-aggregations/date-histogram-aggregation.js
index 562b3995..f15f6b63 100644
--- a/src/aggregations/bucket-aggregations/date-histogram-aggregation.js
+++ b/src/aggregations/bucket-aggregations/date-histogram-aggregation.js
@@ -9,10 +9,10 @@ const HistogramAggregationBase = require('./histogram-aggregation-base');
* [Elasticsearch reference](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-datehistogram-aggregation.html#_scripts)
*
* @example
- * const agg = bob.dateHistogramAggregation('sales_over_time', 'date', 'month');
+ * const agg = esb.dateHistogramAggregation('sales_over_time', 'date', 'month');
*
* @example
- * const agg = bob.dateHistogramAggregation(
+ * const agg = esb.dateHistogramAggregation(
* 'sales_over_time',
* 'date',
* '1M'
@@ -38,7 +38,7 @@ class DateHistogramAggregation extends HistogramAggregationBase {
* Sets the date time zone
*
* @example
- * const agg = bob.dateHistogramAggregation('by_day', 'date', 'day').timeZone(
+ * const agg = esb.dateHistogramAggregation('by_day', 'date', 'day').timeZone(
* '-01:00'
* );
*
diff --git a/src/aggregations/bucket-aggregations/date-range-aggregation.js b/src/aggregations/bucket-aggregations/date-range-aggregation.js
index 061f7184..42af1cc2 100644
--- a/src/aggregations/bucket-aggregations/date-range-aggregation.js
+++ b/src/aggregations/bucket-aggregations/date-range-aggregation.js
@@ -12,7 +12,7 @@ const RangeAggregationBase = require('./range-aggregation-base');
* [Elasticsearch reference](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-daterange-aggregation.html)
*
* @example
- * const agg = bob.dateRangeAggregation('range', 'date')
+ * const agg = esb.dateRangeAggregation('range', 'date')
* .format('MM-yyy')
* .ranges([{ to: 'now-10M/M' }, { from: 'now-10M/M' }]);
*
@@ -35,7 +35,7 @@ class DateRangeAggregation extends RangeAggregationBase {
* bucketing should use a different time zone.
*
* @example
- * const agg = bob.dateRangeAggregation('range', 'date')
+ * const agg = esb.dateRangeAggregation('range', 'date')
* .timeZone('CET')
* .ranges([
* { to: '2016/02/01' },
diff --git a/src/aggregations/bucket-aggregations/diversified-sampler-aggregation.js b/src/aggregations/bucket-aggregations/diversified-sampler-aggregation.js
index f9eccd99..40b73cc2 100644
--- a/src/aggregations/bucket-aggregations/diversified-sampler-aggregation.js
+++ b/src/aggregations/bucket-aggregations/diversified-sampler-aggregation.js
@@ -26,13 +26,13 @@ const invalidExecutionHintParam = invalidParam(
* [Elasticsearch reference](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-diversified-sampler-aggregation.html)
*
* @example
- * const reqBody = bob.requestBodySearch()
- * .query(bob.queryStringQuery('tags:elasticsearch'))
+ * const reqBody = esb.requestBodySearch()
+ * .query(esb.queryStringQuery('tags:elasticsearch'))
* .agg(
- * bob.diversifiedSamplerAggregation('my_unbiased_sample', 'author')
+ * esb.diversifiedSamplerAggregation('my_unbiased_sample', 'author')
* .shardSize(200)
* .agg(
- * bob.significantTermsAggregation(
+ * esb.significantTermsAggregation(
* 'keywords',
* 'tags'
* ).exclude(['elasticsearch'])
@@ -43,15 +43,15 @@ const invalidExecutionHintParam = invalidParam(
* // Use a script to produce a hash of the multiple values in a tags field
* // to ensure we don't have a sample that consists of the same repeated
* // combinations of tags
- * const reqBody = bob.requestBodySearch()
- * .query(bob.queryStringQuery('tags:kibana'))
+ * const reqBody = esb.requestBodySearch()
+ * .query(esb.queryStringQuery('tags:kibana'))
* .agg(
- * bob.diversifiedSamplerAggregation('my_unbiased_sample')
+ * esb.diversifiedSamplerAggregation('my_unbiased_sample')
* .shardSize(200)
* .maxDocsPerValue(3)
- * .script(bob.script('inline', "doc['tags'].values.hashCode()"))
+ * .script(esb.script('inline', "doc['tags'].values.hashCode()"))
* .agg(
- * bob.significantTermsAggregation(
+ * esb.significantTermsAggregation(
* 'keywords',
* 'tags'
* ).exclude(['kibana'])
diff --git a/src/aggregations/bucket-aggregations/filter-aggregation.js b/src/aggregations/bucket-aggregations/filter-aggregation.js
index 376f7913..d8516fae 100644
--- a/src/aggregations/bucket-aggregations/filter-aggregation.js
+++ b/src/aggregations/bucket-aggregations/filter-aggregation.js
@@ -17,12 +17,12 @@ const ES_REF_URL =
* [Elasticsearch reference](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-filter-aggregation.html)
*
* @example
- * const reqBody = bob.requestBodySearch()
+ * const reqBody = esb.requestBodySearch()
* .agg(
- * bob.filterAggregation(
+ * esb.filterAggregation(
* 't_shirts',
- * bob.termQuery('type', 't-shirt')
- * ).agg(bob.avgAggregation('avg_price', 'price'))
+ * esb.termQuery('type', 't-shirt')
+ * ).agg(esb.avgAggregation('avg_price', 'price'))
* )
* .size(0);
*
diff --git a/src/aggregations/bucket-aggregations/filters-aggregation.js b/src/aggregations/bucket-aggregations/filters-aggregation.js
index 89040387..cdfc8bca 100644
--- a/src/aggregations/bucket-aggregations/filters-aggregation.js
+++ b/src/aggregations/bucket-aggregations/filters-aggregation.js
@@ -17,16 +17,16 @@ const ES_REF_URL =
* [Elasticsearch reference](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-filters-aggregation.html)
*
* @example
- * const agg = bob.filtersAggregation('messages')
- * .filter('errors', bob.matchQuery('body', 'error'))
- * .filter('warnings', bob.matchQuery('body', 'warning'));
+ * const agg = esb.filtersAggregation('messages')
+ * .filter('errors', esb.matchQuery('body', 'error'))
+ * .filter('warnings', esb.matchQuery('body', 'warning'));
*
*
* @example
- * const agg = bob.filtersAggregation('messages')
+ * const agg = esb.filtersAggregation('messages')
* .anonymousFilters([
- * bob.matchQuery('body', 'error'),
- * bob.matchQuery('body', 'warning')
+ * esb.matchQuery('body', 'error'),
+ * esb.matchQuery('body', 'warning')
* ])
*
* @param {string} name The name which will be used to refer to this aggregation.
@@ -206,9 +206,9 @@ class FiltersAggregation extends BucketAggregationBase {
* If anonymous filters are being used, setting this parameter will not make sense.
*
* @example
- * const agg = bob.filtersAggregation('messages')
- * .filter('errors', bob.matchQuery('body', 'error'))
- * .filter('warnings', bob.matchQuery('body', 'warning'))
+ * const agg = esb.filtersAggregation('messages')
+ * .filter('errors', esb.matchQuery('body', 'error'))
+ * .filter('warnings', esb.matchQuery('body', 'warning'))
* .otherBucketKey('other_messages');
*
* @param {string} otherBucketKey
diff --git a/src/aggregations/bucket-aggregations/geo-distance-aggregation.js b/src/aggregations/bucket-aggregations/geo-distance-aggregation.js
index b694f831..56d4cc00 100644
--- a/src/aggregations/bucket-aggregations/geo-distance-aggregation.js
+++ b/src/aggregations/bucket-aggregations/geo-distance-aggregation.js
@@ -32,8 +32,8 @@ const invalidDistanceTypeParam = invalidParam(
* [Elasticsearch reference](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-geodistance-aggregation.html)
*
* @example
- * const agg = bob.geoDistanceAggregation('rings_around_amsterdam', 'location')
- * .origin(bob.geoPoint().string('52.3760, 4.894'))
+ * const agg = esb.geoDistanceAggregation('rings_around_amsterdam', 'location')
+ * .origin(esb.geoPoint().string('52.3760, 4.894'))
* .ranges([{ to: 100000 }, { from: 100000, to: 300000 }, { from: 300000 }]);
*
* @param {string} name The name which will be used to refer to this aggregation.
@@ -86,8 +86,8 @@ class GeoDistanceAggregation extends RangeAggregationBase {
* ft(feet), NM(nauticalmiles)
*
* @example
- * const agg = bob.geoDistanceAggregation('rings_around_amsterdam', 'location')
- * .origin(bob.geoPoint().string('52.3760, 4.894'))
+ * const agg = esb.geoDistanceAggregation('rings_around_amsterdam', 'location')
+ * .origin(esb.geoPoint().string('52.3760, 4.894'))
* .unit('km')
* .ranges([{ to: 100 }, { from: 100, to: 300 }, { from: 300 }]);
*
@@ -110,8 +110,8 @@ class GeoDistanceAggregation extends RangeAggregationBase {
* The `plane` is the faster but least accurate.
*
* @example
- * const agg = bob.geoDistanceAggregation('rings_around_amsterdam', 'location')
- * .origin(bob.geoPoint().string('52.3760, 4.894'))
+ * const agg = esb.geoDistanceAggregation('rings_around_amsterdam', 'location')
+ * .origin(esb.geoPoint().string('52.3760, 4.894'))
* .unit('km')
* .distanceType('plane')
* .ranges([{ to: 100 }, { from: 100, to: 300 }, { from: 300 }]);
diff --git a/src/aggregations/bucket-aggregations/geo-hash-grid-aggregation.js b/src/aggregations/bucket-aggregations/geo-hash-grid-aggregation.js
index 8d1f53d8..846bb34d 100644
--- a/src/aggregations/bucket-aggregations/geo-hash-grid-aggregation.js
+++ b/src/aggregations/bucket-aggregations/geo-hash-grid-aggregation.js
@@ -16,7 +16,7 @@ const ES_REF_URL =
* [Elasticsearch reference](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-geohashgrid-aggregation.html)
*
* @example
- * const agg = bob.geoHashGridAggregation('large-grid', 'location').precision(3);
+ * const agg = esb.geoHashGridAggregation('large-grid', 'location').precision(3);
*
* @param {string} name The name which will be used to refer to this aggregation.
* @param {string=} field The field to aggregate on
diff --git a/src/aggregations/bucket-aggregations/global-aggregation.js b/src/aggregations/bucket-aggregations/global-aggregation.js
index cbeb0649..0c8f386d 100644
--- a/src/aggregations/bucket-aggregations/global-aggregation.js
+++ b/src/aggregations/bucket-aggregations/global-aggregation.js
@@ -13,14 +13,14 @@ const ES_REF_URL =
* [Elasticsearch reference](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-global-aggregation.html)
*
* @example
- * const reqBody = bob.requestBodySearch()
- * .query(bob.matchQuery('type', 't-shirt'))
+ * const reqBody = esb.requestBodySearch()
+ * .query(esb.matchQuery('type', 't-shirt'))
* .agg(
- * bob.globalAggregation('all_products').agg(
- * bob.avgAggregation('avg_price', 'price')
+ * esb.globalAggregation('all_products').agg(
+ * esb.avgAggregation('avg_price', 'price')
* )
* )
- * .agg(bob.avgAggregation('t_shirts', 'price'));
+ * .agg(esb.avgAggregation('t_shirts', 'price'));
*
* @param {string} name The name which will be used to refer to this aggregation.
*
diff --git a/src/aggregations/bucket-aggregations/histogram-aggregation-base.js b/src/aggregations/bucket-aggregations/histogram-aggregation-base.js
index cdcf7055..d60a8eda 100644
--- a/src/aggregations/bucket-aggregations/histogram-aggregation-base.js
+++ b/src/aggregations/bucket-aggregations/histogram-aggregation-base.js
@@ -51,7 +51,7 @@ class HistogramAggregationBase extends BucketAggregationBase {
* If no format is specified, then it will use the first format specified in the field mapping.
*
* @example
- * const agg = bob.dateHistogramAggregation(
+ * const agg = esb.dateHistogramAggregation(
* 'sales_over_time',
* 'date',
* '1M'
@@ -74,7 +74,7 @@ class HistogramAggregationBase extends BucketAggregationBase {
* a value such as 1h for an hour, or 1d for a day.
*
* @example
- * const agg = bob.dateHistogramAggregation('by_day', 'date', 'day').offset('6h');
+ * const agg = esb.dateHistogramAggregation('by_day', 'date', 'day').offset('6h');
*
* @param {string} offset Time or bucket key offset for bucketing.
* @returns {HistogramAggregationBase} returns `this` so that calls can be chained
@@ -88,16 +88,16 @@ class HistogramAggregationBase extends BucketAggregationBase {
* Sets the ordering for buckets
*
* @example
- * const agg = bob.histogramAggregation('prices', 'price', 50)
+ * const agg = esb.histogramAggregation('prices', 'price', 50)
* .order('_count', 'desc');
*
* @example
- * const agg = bob.histogramAggregation('prices', 'price', 50)
+ * const agg = esb.histogramAggregation('prices', 'price', 50)
* .order('promoted_products>rating_stats.avg', 'desc')
* .agg(
- * bob.filterAggregation('promoted_products')
- * .filter(bob.termQuery('promoted', 'true'))
- * .agg(bob.statsAggregation('rating_stats', 'rating'))
+ * esb.filterAggregation('promoted_products')
+ * .filter(esb.termQuery('promoted', 'true'))
+ * .agg(esb.statsAggregation('rating_stats', 'rating'))
* );
*
* @param {string} key
@@ -129,7 +129,7 @@ class HistogramAggregationBase extends BucketAggregationBase {
* Sets the minimum number of matching documents in range to return the bucket.
*
* @example
- * const agg = bob.histogramAggregation('prices', 'price', 50).minDocCount(1);
+ * const agg = esb.histogramAggregation('prices', 'price', 50).minDocCount(1);
*
* @param {number} minDocCnt Integer value for minimum number of documents
* required to return bucket in response
@@ -146,7 +146,7 @@ class HistogramAggregationBase extends BucketAggregationBase {
* outside the bounds of indexed documents.
*
* @example
- * const agg = bob.histogramAggregation('prices', 'price', 50).extendedBounds(0, 500);
+ * const agg = esb.histogramAggregation('prices', 'price', 50).extendedBounds(0, 500);
*
* @param {number|string} min Start bound / minimum bound value
* For histogram aggregation, Integer value can be used.
@@ -170,7 +170,7 @@ class HistogramAggregationBase extends BucketAggregationBase {
* that are missing a value should be treated.
*
* @example
- * const agg = bob.histogramAggregation('quantity', 'quantity', 10).missing(0);
+ * const agg = esb.histogramAggregation('quantity', 'quantity', 10).missing(0);
*
* @param {string} value
* @returns {HistogramAggregationBase} returns `this` so that calls can be chained
@@ -185,7 +185,7 @@ class HistogramAggregationBase extends BucketAggregationBase {
* bucket interval.
*
* @example
- * const agg = bob.dateHistogramAggregation('sales_over_time', 'date', '1M')
+ * const agg = esb.dateHistogramAggregation('sales_over_time', 'date', '1M')
* .keyed(true)
* .format('yyyy-MM-dd');
*
diff --git a/src/aggregations/bucket-aggregations/histogram-aggregation.js b/src/aggregations/bucket-aggregations/histogram-aggregation.js
index 8bb61fa2..a283dbdd 100644
--- a/src/aggregations/bucket-aggregations/histogram-aggregation.js
+++ b/src/aggregations/bucket-aggregations/histogram-aggregation.js
@@ -14,17 +14,17 @@ const HistogramAggregationBase = require('./histogram-aggregation-base');
* @param {number=} interval Interval to generate histogram over.
*
* @example
- * const agg = bob.histogramAggregation('prices', 'price', 50);
+ * const agg = esb.histogramAggregation('prices', 'price', 50);
*
* @example
- * const agg = bob.histogramAggregation('prices', 'price', 50).minDocCount(1);
+ * const agg = esb.histogramAggregation('prices', 'price', 50).minDocCount(1);
*
* @example
- * const agg = bob.histogramAggregation('prices', 'price', 50)
+ * const agg = esb.histogramAggregation('prices', 'price', 50)
* .extendedBounds(0, 500);
*
* @example
- * const agg = bob.histogramAggregation('quantity', 'quantity', 10).missing(0);
+ * const agg = esb.histogramAggregation('quantity', 'quantity', 10).missing(0);
*
* @extends HistogramAggregationBase
*/
diff --git a/src/aggregations/bucket-aggregations/ip-range-aggregation.js b/src/aggregations/bucket-aggregations/ip-range-aggregation.js
index 81091d34..7cb53d65 100644
--- a/src/aggregations/bucket-aggregations/ip-range-aggregation.js
+++ b/src/aggregations/bucket-aggregations/ip-range-aggregation.js
@@ -11,13 +11,13 @@ const ES_REF_URL =
* [Elasticsearch reference](https://www.elastic.co/guide/en/elasticsearch/reference/5current/search-aggregations-bucket-iprange-aggregation.html)
*
* @example
- * const agg = bob.ipRangeAggregation('ip_ranges', 'ip').ranges([
+ * const agg = esb.ipRangeAggregation('ip_ranges', 'ip').ranges([
* { to: '10.0.0.5' },
* { from: '10.0.0.5' }
* ]);
*
* @example
- * const agg = bob.ipRangeAggregation('ip_ranges', 'ip').ranges([
+ * const agg = esb.ipRangeAggregation('ip_ranges', 'ip').ranges([
* { mask: '10.0.0.0/25' },
* { mask: '10.0.0.127/25' }
* ]);
diff --git a/src/aggregations/bucket-aggregations/missing-aggregation.js b/src/aggregations/bucket-aggregations/missing-aggregation.js
index 82f39d19..40116cb9 100644
--- a/src/aggregations/bucket-aggregations/missing-aggregation.js
+++ b/src/aggregations/bucket-aggregations/missing-aggregation.js
@@ -13,7 +13,7 @@ const ES_REF_URL =
* [Elasticsearch reference](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-missing-aggregation.html)
*
* @example
- * const agg = bob.missingAggregation('products_without_a_price', 'price');
+ * const agg = esb.missingAggregation('products_without_a_price', 'price');
*
* @param {string} name The name which will be used to refer to this aggregation.
* @param {string=} field The field to aggregate on
diff --git a/src/aggregations/bucket-aggregations/nested-aggregation.js b/src/aggregations/bucket-aggregations/nested-aggregation.js
index a990ced1..8b79018f 100644
--- a/src/aggregations/bucket-aggregations/nested-aggregation.js
+++ b/src/aggregations/bucket-aggregations/nested-aggregation.js
@@ -14,11 +14,11 @@ const ES_REF_URL =
* [Elasticsearch reference](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-nested-aggregation.html)
*
* @example
- * const reqBody = bob.requestBodySearch()
- * .query(bob.matchQuery('name', 'led tv'))
+ * const reqBody = esb.requestBodySearch()
+ * .query(esb.matchQuery('name', 'led tv'))
* .agg(
- * bob.nestedAggregation('resellers', 'resellers').agg(
- * bob.minAggregation('min_price', 'resellers.price')
+ * esb.nestedAggregation('resellers', 'resellers').agg(
+ * esb.minAggregation('min_price', 'resellers.price')
* )
* );
*
diff --git a/src/aggregations/bucket-aggregations/range-aggregation-base.js b/src/aggregations/bucket-aggregations/range-aggregation-base.js
index f1625f7e..b5f0c438 100644
--- a/src/aggregations/bucket-aggregations/range-aggregation-base.js
+++ b/src/aggregations/bucket-aggregations/range-aggregation-base.js
@@ -105,14 +105,14 @@ class RangeAggregationBase extends BucketAggregationBase {
* bucket interval.
*
* @example
- * const agg = bob.dateRangeAggregation('range', 'date')
+ * const agg = esb.dateRangeAggregation('range', 'date')
* .format('MM-yyy')
* .ranges([{ to: 'now-10M/M' }, { from: 'now-10M/M' }])
* .keyed(true);
*
* @example
- * const agg = bob.geoDistanceAggregation('rings_around_amsterdam', 'location')
- * .origin(bob.geoPoint().string('52.3760, 4.894'))
+ * const agg = esb.geoDistanceAggregation('rings_around_amsterdam', 'location')
+ * .origin(esb.geoPoint().string('52.3760, 4.894'))
* .ranges([
* { to: 100000, key: 'first_ring' },
* { from: 100000, to: 300000, key: 'second_ring' },
diff --git a/src/aggregations/bucket-aggregations/range-aggregation.js b/src/aggregations/bucket-aggregations/range-aggregation.js
index fd64f20a..9dc202b5 100644
--- a/src/aggregations/bucket-aggregations/range-aggregation.js
+++ b/src/aggregations/bucket-aggregations/range-aggregation.js
@@ -14,22 +14,22 @@ const RangeAggregationBase = require('./range-aggregation-base');
* [Elasticsearch reference](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-range-aggregation.html)
*
* @example
- * const agg = bob.rangeAggregation('price_ranges', 'price').ranges([
+ * const agg = esb.rangeAggregation('price_ranges', 'price').ranges([
* { to: 50 },
* { from: 50, to: 100 },
* { from: 100 }
* ]);
*
* @example
- * const agg = bob.rangeAggregation('price_ranges')
- * .script(bob.script('inline', "doc['price'].value").lang('painless'))
+ * const agg = esb.rangeAggregation('price_ranges')
+ * .script(esb.script('inline', "doc['price'].value").lang('painless'))
* .ranges([{ to: 50 }, { from: 50, to: 100 }, { from: 100 }]);
*
* @example
* // Value script for on-the-fly conversion before aggregation
- * const agg = bob.rangeAggregation('price_ranges', 'price')
+ * const agg = esb.rangeAggregation('price_ranges', 'price')
* .script(
- * bob.script('inline', '_value * params.conversion_rate')
+ * esb.script('inline', '_value * params.conversion_rate')
* .lang('painless')
* .params({ conversion_rate: 0.8 })
* )
@@ -37,10 +37,10 @@ const RangeAggregationBase = require('./range-aggregation-base');
*
* @example
* // Compute statistics over the prices in each price range
- * const agg = bob.rangeAggregation('price_ranges', 'price')
+ * const agg = esb.rangeAggregation('price_ranges', 'price')
* .ranges([{ to: 50 }, { from: 50, to: 100 }, { from: 100 }])
* // Passing price to Stats Aggregation is optional(same value source)
- * .agg(bob.statsAggregation('price_stats', 'price'));
+ * .agg(esb.statsAggregation('price_stats', 'price'));
*
* @param {string} name The name which will be used to refer to this aggregation.
* @param {string=} field The field to aggregate on
diff --git a/src/aggregations/bucket-aggregations/reverse-nested-aggregation.js b/src/aggregations/bucket-aggregations/reverse-nested-aggregation.js
index 7c6107a5..3c2ae03d 100644
--- a/src/aggregations/bucket-aggregations/reverse-nested-aggregation.js
+++ b/src/aggregations/bucket-aggregations/reverse-nested-aggregation.js
@@ -20,13 +20,13 @@ const ES_REF_URL =
* [Elasticsearch reference](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-reverse-nested-aggregation.html)
*
* @example
- * const reqBody = bob.requestBodySearch()
- * .query(bob.matchQuery('name', 'led tv'))
+ * const reqBody = esb.requestBodySearch()
+ * .query(esb.matchQuery('name', 'led tv'))
* .agg(
- * bob.nestedAggregation('comments', 'comments').agg(
- * bob.termsAggregation('top_usernames', 'comments.username').agg(
- * bob.reverseNestedAggregation('comment_to_issue').agg(
- * bob.termsAggregation('top_tags_per_comment', 'tags')
+ * esb.nestedAggregation('comments', 'comments').agg(
+ * esb.termsAggregation('top_usernames', 'comments.username').agg(
+ * esb.reverseNestedAggregation('comment_to_issue').agg(
+ * esb.termsAggregation('top_tags_per_comment', 'tags')
* )
* )
* )
diff --git a/src/aggregations/bucket-aggregations/sampler-aggregation.js b/src/aggregations/bucket-aggregations/sampler-aggregation.js
index 8d9bb707..b7f0221b 100644
--- a/src/aggregations/bucket-aggregations/sampler-aggregation.js
+++ b/src/aggregations/bucket-aggregations/sampler-aggregation.js
@@ -12,13 +12,13 @@ const ES_REF_URL =
* [Elasticsearch reference](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-sampler-aggregation.html)
*
* @example
- * const reqBody = bob.requestBodySearch()
- * .query(bob.queryStringQuery('tags:kibana OR tags:javascript'))
+ * const reqBody = esb.requestBodySearch()
+ * .query(esb.queryStringQuery('tags:kibana OR tags:javascript'))
* .agg(
- * bob.samplerAggregation('sample')
+ * esb.samplerAggregation('sample')
* .shardSize(200)
* .agg(
- * bob.significantTermsAggregation(
+ * esb.significantTermsAggregation(
* 'keywords',
* 'tags'
* ).exclude(['kibana', 'javascript'])
diff --git a/src/aggregations/bucket-aggregations/significant-terms-aggregation.js b/src/aggregations/bucket-aggregations/significant-terms-aggregation.js
index 4d64bd77..6f34f312 100644
--- a/src/aggregations/bucket-aggregations/significant-terms-aggregation.js
+++ b/src/aggregations/bucket-aggregations/significant-terms-aggregation.js
@@ -14,10 +14,10 @@ const ES_REF_URL =
* [Elasticsearch reference](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-significantterms-aggregation.html)
*
* @example
- * const reqBody = bob.requestBodySearch()
- * .query(bob.termsQuery('force', 'British Transport Police'))
+ * const reqBody = esb.requestBodySearch()
+ * .query(esb.termsQuery('force', 'British Transport Police'))
* .agg(
- * bob.significantTermsAggregation(
+ * esb.significantTermsAggregation(
* 'significantCrimeTypes',
* 'crime_type'
* )
@@ -25,8 +25,8 @@ const ES_REF_URL =
*
* @example
* // Use parent aggregation for segregated data analysis
- * const agg = bob.termsAggregation('forces', 'force').agg(
- * bob.significantTermsAggregation('significantCrimeTypes', 'crime_type')
+ * const agg = esb.termsAggregation('forces', 'force').agg(
+ * esb.significantTermsAggregation('significantCrimeTypes', 'crime_type')
* );
*
* @param {string} name The name which will be used to refer to this aggregation.
@@ -135,11 +135,11 @@ class SignificantTermsAggregation extends TermsAggregationBase {
* for background term frequencies instead of using the entire index.
*
* @example
- * const reqBody = bob.requestBodySearch()
- * .query(bob.matchQuery('text', 'madrid'))
+ * const reqBody = esb.requestBodySearch()
+ * .query(esb.matchQuery('text', 'madrid'))
* .agg(
- * bob.significantTermsAggregation('tags', 'tag').backgroundFilter(
- * bob.termQuery('text', 'spain')
+ * esb.significantTermsAggregation('tags', 'tag').backgroundFilter(
+ * esb.termQuery('text', 'spain')
* )
* );
*
diff --git a/src/aggregations/bucket-aggregations/terms-aggregation-base.js b/src/aggregations/bucket-aggregations/terms-aggregation-base.js
index 1195cab0..327fe17a 100644
--- a/src/aggregations/bucket-aggregations/terms-aggregation-base.js
+++ b/src/aggregations/bucket-aggregations/terms-aggregation-base.js
@@ -55,7 +55,7 @@ class TermsAggregationBase extends BucketAggregationBase {
* Sets the minimum number of matching hits required to return the terms.
*
* @example
- * const agg = bob.significantTermsAggregation('tags', 'tag').minDocCount(10);
+ * const agg = esb.significantTermsAggregation('tags', 'tag').minDocCount(10);
*
* @param {number} minDocCnt Integer value for minimum number of documents
* required to return bucket in response
@@ -86,7 +86,7 @@ class TermsAggregationBase extends BucketAggregationBase {
* Defines how many term buckets should be returned out of the overall terms list.
*
* @example
- * const agg = bob.termsAggregation('products', 'product').size(5);
+ * const agg = esb.termsAggregation('products', 'product').size(5);
*
* @param {number} size
* @returns {TermsAggregationBase} returns `this` so that calls can be chained
@@ -128,21 +128,21 @@ class TermsAggregationBase extends BucketAggregationBase {
* Filter the values for which buckets will be created.
*
* @example
- * const agg = bob.termsAggregation('tags', 'tags')
+ * const agg = esb.termsAggregation('tags', 'tags')
* .include('.*sport.*')
* .exclude('water_.*');
*
* @example
* // Match on exact values
- * const reqBody = bob.requestBodySearch()
+ * const reqBody = esb.requestBodySearch()
* .agg(
- * bob.termsAggregation('JapaneseCars', 'make').include([
+ * esb.termsAggregation('JapaneseCars', 'make').include([
* 'mazda',
* 'honda'
* ])
* )
* .agg(
- * bob.termsAggregation('ActiveCarManufacturers', 'make').exclude([
+ * esb.termsAggregation('ActiveCarManufacturers', 'make').exclude([
* 'rover',
* 'jensen'
* ])
@@ -160,21 +160,21 @@ class TermsAggregationBase extends BucketAggregationBase {
* Filter the values for which buckets will be created.
*
* @example
- * const agg = bob.termsAggregation('tags', 'tags')
+ * const agg = esb.termsAggregation('tags', 'tags')
* .include('.*sport.*')
* .exclude('water_.*');
*
* @example
* // Match on exact values
- * const reqBody = bob.requestBodySearch()
+ * const reqBody = esb.requestBodySearch()
* .agg(
- * bob.termsAggregation('JapaneseCars', 'make').include([
+ * esb.termsAggregation('JapaneseCars', 'make').include([
* 'mazda',
* 'honda'
* ])
* )
* .agg(
- * bob.termsAggregation('ActiveCarManufacturers', 'make').exclude([
+ * esb.termsAggregation('ActiveCarManufacturers', 'make').exclude([
* 'rover',
* 'jensen'
* ])
@@ -195,10 +195,10 @@ class TermsAggregationBase extends BucketAggregationBase {
* the type of value held can be controlled
*
* @example
- * const agg = bob.significantTermsAggregation('tags', 'tag').executionHint('map');
+ * const agg = esb.significantTermsAggregation('tags', 'tag').executionHint('map');
*
* @example
- * const agg = bob.termsAggregation('tags', 'tags').executionHint('map');
+ * const agg = esb.termsAggregation('tags', 'tags').executionHint('map');
*
* @param {string} hint the possible values are `map`, `global_ordinals`,
* `global_ordinals_hash` and `global_ordinals_low_cardinality`
diff --git a/src/aggregations/bucket-aggregations/terms-aggregation.js b/src/aggregations/bucket-aggregations/terms-aggregation.js
index 0275e29b..d7d4c43e 100644
--- a/src/aggregations/bucket-aggregations/terms-aggregation.js
+++ b/src/aggregations/bucket-aggregations/terms-aggregation.js
@@ -28,7 +28,7 @@ const invalidCollectModeParam = invalidParam(
* [Elasticsearch reference](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-terms-aggregation.html)
*
* @example
- * const agg = bob.termsAggregation('genres', 'genre');
+ * const agg = esb.termsAggregation('genres', 'genre');
*
* @param {string} name The name which will be used to refer to this aggregation.
* @param {string=} field The field to aggregate on
@@ -65,11 +65,11 @@ class TermsAggregation extends TermsAggregationBase {
* could change depending on community interest.
*
* @example
- * const agg = bob.termsAggregation('expired_sessions', 'account_id')
+ * const agg = esb.termsAggregation('expired_sessions', 'account_id')
* .includePartition(0, 20)
* .size(10000)
* .order('last_access', 'asc')
- * .agg(bob.maxAggregation('last_access', 'access_date'));
+ * .agg(esb.maxAggregation('last_access', 'access_date'));
*
* @param {number} partition
* @param {number} numPartitions
@@ -90,10 +90,10 @@ class TermsAggregation extends TermsAggregationBase {
* tree are expanded in one depth-first pass and only then any pruning occurs.
*
* @example
- * const agg = bob.termsAggregation('actors', 'actors')
+ * const agg = esb.termsAggregation('actors', 'actors')
* .size(10)
* .collectMode('breadth_first')
- * .agg(bob.termsAggregation('costars', 'actors').size(5));
+ * .agg(esb.termsAggregation('costars', 'actors').size(5));
*
* @param {string} mode The possible values are `breadth_first` and `depth_first`.
* @returns {TermsAggregation} returns `this` so that calls can be chained
@@ -115,36 +115,36 @@ class TermsAggregation extends TermsAggregationBase {
*
* @example
* // Ordering the buckets by their doc `_count` in an ascending manner
- * const agg = bob.termsAggregation('genres', 'genre').order('_count', 'asc');
+ * const agg = esb.termsAggregation('genres', 'genre').order('_count', 'asc');
*
* @example
* // Ordering the buckets alphabetically by their terms in an ascending manner
- * const agg = bob.termsAggregation('genres', 'genre').order('_term', 'asc');
+ * const agg = esb.termsAggregation('genres', 'genre').order('_term', 'asc');
*
* @example
* // Ordering the buckets by single value metrics sub-aggregation
* // (identified by the aggregation name)
- * const agg = bob.termsAggregation('genres', 'genre')
+ * const agg = esb.termsAggregation('genres', 'genre')
* .order('max_play_count', 'asc')
- * .agg(bob.maxAggregation('max_play_count', 'play_count'));
+ * .agg(esb.maxAggregation('max_play_count', 'play_count'));
*
* @example
* // Ordering the buckets by multi value metrics sub-aggregation
* // (identified by the aggregation name):
- * const agg = bob.termsAggregation('genres', 'genre')
+ * const agg = esb.termsAggregation('genres', 'genre')
* .order('playback_stats.max', 'desc')
- * .agg(bob.statsAggregation('playback_stats', 'play_count'));
+ * .agg(esb.statsAggregation('playback_stats', 'play_count'));
*
* @example
* // Multiple order criteria
- * const agg = bob.termsAggregation('countries')
+ * const agg = esb.termsAggregation('countries')
* .field('artist.country')
* .order('rock>playback_stats.avg', 'desc')
* .order('_count', 'desc')
* .agg(
- * bob.filterAggregation('rock')
- * .filter(bob.termQuery('genre', 'rock'))
- * .agg(bob.statsAggregation('playback_stats', 'play_count'))
+ * esb.filterAggregation('rock')
+ * .filter(esb.termQuery('genre', 'rock'))
+ * .agg(esb.statsAggregation('playback_stats', 'play_count'))
* );
*
* @param {string} key
diff --git a/src/aggregations/matrix-aggregations/matrix-stats-aggregation.js b/src/aggregations/matrix-aggregations/matrix-stats-aggregation.js
index b22ad366..69909a3f 100644
--- a/src/aggregations/matrix-aggregations/matrix-stats-aggregation.js
+++ b/src/aggregations/matrix-aggregations/matrix-stats-aggregation.js
@@ -11,7 +11,7 @@ const { Aggregation, util: { checkType } } = require('../../core');
* [Elasticsearch reference](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-matrix-stats-aggregation.html)
*
* @example
- * const agg = bob.matrixStatsAggregation('matrixstats', ['poverty', 'income']);
+ * const agg = esb.matrixStatsAggregation('matrixstats', ['poverty', 'income']);
*
* @param {string} name A valid aggregation name
* @param {Array=} fields Array of fields
@@ -31,7 +31,7 @@ class MatrixStatsAggregation extends Aggregation {
* the statistics.
*
* @example
- * const agg = bob.matrixStatsAggregation('matrixstats')
+ * const agg = esb.matrixStatsAggregation('matrixstats')
* .fields(['poverty', 'income']);
*
* @param {Array} fields Array of fields
@@ -62,7 +62,7 @@ class MatrixStatsAggregation extends Aggregation {
* them as if they had a value.
*
* @example
- * const agg = bob.matrixStatsAggregation('matrixstats')
+ * const agg = esb.matrixStatsAggregation('matrixstats')
* .fields(['poverty', 'income'])
* .missing({ income: 50000 });
*
diff --git a/src/aggregations/metrics-aggregations/avg-aggregation.js b/src/aggregations/metrics-aggregations/avg-aggregation.js
index cc33c4b7..e2d62c0c 100644
--- a/src/aggregations/metrics-aggregations/avg-aggregation.js
+++ b/src/aggregations/metrics-aggregations/avg-aggregation.js
@@ -15,25 +15,25 @@ const MetricsAggregationBase = require('./metrics-aggregation-base');
*
* @example
* // Compute the average grade over all documents
- * const agg = bob.avgAggregation('avg_grade', 'grade');
+ * const agg = esb.avgAggregation('avg_grade', 'grade');
*
* @example
* // Compute the average grade based on a script
- * const agg = bob.avgAggregation('avg_grade').script(
- * bob.script('inline', "doc['grade'].value").lang('painless')
+ * const agg = esb.avgAggregation('avg_grade').script(
+ * esb.script('inline', "doc['grade'].value").lang('painless')
* );
*
* @example
* // Value script, apply grade correction
- * const agg = bob.avgAggregation('avg_grade', 'grade').script(
- * bob.script('inline', '_value * params.correction')
+ * const agg = esb.avgAggregation('avg_grade', 'grade').script(
+ * esb.script('inline', '_value * params.correction')
* .lang('painless')
* .params({ correction: 1.2 })
* );
*
* @example
* // Missing value
- * const agg = bob.avgAggregation('avg_grade', 'grade').missing(10);
+ * const agg = esb.avgAggregation('avg_grade', 'grade').missing(10);
*
* @param {string} name The name which will be used to refer to this aggregation.
* @param {string=} field The field to aggregate on
diff --git a/src/aggregations/metrics-aggregations/cardinality-aggregation.js b/src/aggregations/metrics-aggregations/cardinality-aggregation.js
index 94e56227..4eb39076 100644
--- a/src/aggregations/metrics-aggregations/cardinality-aggregation.js
+++ b/src/aggregations/metrics-aggregations/cardinality-aggregation.js
@@ -15,11 +15,11 @@ const ES_REF_URL =
* Aggregation that calculates an approximate count of distinct values.
*
* @example
- * const agg = bob.cardinalityAggregation('author_count', 'author');
+ * const agg = esb.cardinalityAggregation('author_count', 'author');
*
* @example
- * const agg = bob.cardinalityAggregation('author_count').script(
- * bob.script(
+ * const agg = esb.cardinalityAggregation('author_count').script(
+ * esb.script(
* 'inline',
* "doc['author.first_name'].value + ' ' + doc['author.last_name'].value"
* ).lang('painless')
@@ -51,7 +51,7 @@ class CardinalityAggregation extends MetricsAggregationBase {
* and defines a unique count below which counts are expected to be close to accurate.
*
* @example
- * const agg = bob.cardinalityAggregation(
+ * const agg = esb.cardinalityAggregation(
* 'author_count',
* 'author_hash'
* ).precisionThreshold(100);
diff --git a/src/aggregations/metrics-aggregations/extended-stats-aggregation.js b/src/aggregations/metrics-aggregations/extended-stats-aggregation.js
index 2aa6d7a2..57609762 100644
--- a/src/aggregations/metrics-aggregations/extended-stats-aggregation.js
+++ b/src/aggregations/metrics-aggregations/extended-stats-aggregation.js
@@ -14,25 +14,25 @@ const MetricsAggregationBase = require('./metrics-aggregation-base');
* the aggregated documents.
*
* @example
- * const agg = bob.extendedStatsAggregation('grades_stats', 'grade');
+ * const agg = esb.extendedStatsAggregation('grades_stats', 'grade');
*
* @example
* // Compute the grade stats based on a script
- * const agg = bob.extendedStatsAggregation('grades_stats').script(
- * bob.script('inline', "doc['grade'].value").lang('painless')
+ * const agg = esb.extendedStatsAggregation('grades_stats').script(
+ * esb.script('inline', "doc['grade'].value").lang('painless')
* );
*
* @example
* // Value script, apply grade correction
- * const agg = bob.extendedStatsAggregation('grades_stats', 'grade').script(
- * bob.script('inline', '_value * params.correction')
+ * const agg = esb.extendedStatsAggregation('grades_stats', 'grade').script(
+ * esb.script('inline', '_value * params.correction')
* .lang('painless')
* .params({ correction: 1.2 })
* );
*
* @example
* // Missing value
- * const agg = bob.extendedStatsAggregation('grades_stats', 'grade').missing(0);
+ * const agg = esb.extendedStatsAggregation('grades_stats', 'grade').missing(0);
*
* @param {string} name The name which will be used to refer to this aggregation.
* @param {string=} field The field to aggregate on
@@ -50,7 +50,7 @@ class ExtendedStatsAggregation extends MetricsAggregationBase {
* sigma controls how many standard deviations +/- from the mean should be displayed
*
* @example
- * const agg = bob.extendedStatsAggregation('grades_stats', 'grade').sigma(3);
+ * const agg = esb.extendedStatsAggregation('grades_stats', 'grade').sigma(3);
*
* @param {number} sigma sigma can be any non-negative double,
* meaning you can request non-integer values such as 1.5.
diff --git a/src/aggregations/metrics-aggregations/geo-bounds-aggregation.js b/src/aggregations/metrics-aggregations/geo-bounds-aggregation.js
index 51734b9a..6d2d41d0 100644
--- a/src/aggregations/metrics-aggregations/geo-bounds-aggregation.js
+++ b/src/aggregations/metrics-aggregations/geo-bounds-aggregation.js
@@ -12,7 +12,7 @@ const ES_REF_URL =
* [Elasticsearch reference](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-metrics-geobounds-aggregation.html)
*
* @example
- * const agg = bob.geoBoundsAggregation('viewport', 'location').wrapLongitude(true);
+ * const agg = esb.geoBoundsAggregation('viewport', 'location').wrapLongitude(true);
*
* @param {string} name The name which will be used to refer to this aggregation.
* @param {string=} field The field to aggregate on
diff --git a/src/aggregations/metrics-aggregations/geo-centroid-aggregation.js b/src/aggregations/metrics-aggregations/geo-centroid-aggregation.js
index a23e4115..dca01c29 100644
--- a/src/aggregations/metrics-aggregations/geo-centroid-aggregation.js
+++ b/src/aggregations/metrics-aggregations/geo-centroid-aggregation.js
@@ -12,15 +12,15 @@ const ES_REF_URL =
* [Elasticsearchreference](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-metrics-geocentroid-aggregation.html)
*
* @example
- * const agg = bob.geoCentroidAggregation('centroid', 'location');
+ * const agg = esb.geoCentroidAggregation('centroid', 'location');
*
* @example
* // Combined as a sub-aggregation to other bucket aggregations
- * const reqBody = bob.requestBodySearch()
- * .query(bob.matchQuery('crime', 'burglary'))
+ * const reqBody = esb.requestBodySearch()
+ * .query(esb.matchQuery('crime', 'burglary'))
* .agg(
- * bob.termsAggregation('towns', 'town').agg(
- * bob.geoCentroidAggregation('centroid', 'location')
+ * esb.termsAggregation('towns', 'town').agg(
+ * esb.geoCentroidAggregation('centroid', 'location')
* )
* );
*
diff --git a/src/aggregations/metrics-aggregations/max-aggregation.js b/src/aggregations/metrics-aggregations/max-aggregation.js
index 501df4f2..a3af3099 100644
--- a/src/aggregations/metrics-aggregations/max-aggregation.js
+++ b/src/aggregations/metrics-aggregations/max-aggregation.js
@@ -14,19 +14,19 @@ const MetricsAggregationBase = require('./metrics-aggregation-base');
* numeric values extracted from the aggregated documents.
*
* @example
- * const agg = bob.maxAggregation('max_price', 'price');
+ * const agg = esb.maxAggregation('max_price', 'price');
*
* @example
* // Use a file script
- * const agg = bob.maxAggregation('max_price').script(
- * bob.script('file', 'my_script').params({ field: 'price' })
+ * const agg = esb.maxAggregation('max_price').script(
+ * esb.script('file', 'my_script').params({ field: 'price' })
* );
*
* @example
* // Value script to apply the conversion rate to every value
* // before it is aggregated
- * const agg = bob.maxAggregation('max_price').script(
- * bob.script('inline', '_value * params.conversion_rate').params({
+ * const agg = esb.maxAggregation('max_price').script(
+ * esb.script('inline', '_value * params.conversion_rate').params({
* conversion_rate: 1.2
* })
* );
diff --git a/src/aggregations/metrics-aggregations/metrics-aggregation-base.js b/src/aggregations/metrics-aggregations/metrics-aggregation-base.js
index 58f0af46..18206313 100644
--- a/src/aggregations/metrics-aggregations/metrics-aggregation-base.js
+++ b/src/aggregations/metrics-aggregations/metrics-aggregation-base.js
@@ -47,14 +47,14 @@ class MetricsAggregationBase extends Aggregation {
*
* @example
* // Compute the average grade based on a script
- * const agg = bob.avgAggregation('avg_grade').script(
- * bob.script('inline', "doc['grade'].value").lang('painless')
+ * const agg = esb.avgAggregation('avg_grade').script(
+ * esb.script('inline', "doc['grade'].value").lang('painless')
* );
*
* @example
* // Value script, apply grade correction
- * const agg = bob.avgAggregation('avg_grade', 'grade').script(
- * bob.script('inline', '_value * params.correction')
+ * const agg = esb.avgAggregation('avg_grade', 'grade').script(
+ * esb.script('inline', '_value * params.correction')
* .lang('painless')
* .params({ correction: 1.2 })
* );
@@ -75,7 +75,7 @@ class MetricsAggregationBase extends Aggregation {
* that are missing a value should be treated.
*
* @example
- * const agg = bob.avgAggregation('avg_grade', 'grade').missing(10);
+ * const agg = esb.avgAggregation('avg_grade', 'grade').missing(10);
*
* @param {string} value
* @returns {MetricsAggregationBase} returns `this` so that calls can be chained
diff --git a/src/aggregations/metrics-aggregations/min-aggregation.js b/src/aggregations/metrics-aggregations/min-aggregation.js
index 34d9d7e8..f4edbd10 100644
--- a/src/aggregations/metrics-aggregations/min-aggregation.js
+++ b/src/aggregations/metrics-aggregations/min-aggregation.js
@@ -14,19 +14,19 @@ const MetricsAggregationBase = require('./metrics-aggregation-base');
* values extracted from the aggregated documents.
*
* @example
- * const agg = bob.minAggregation('min_price', 'price');
+ * const agg = esb.minAggregation('min_price', 'price');
*
* @example
* // Use a file script
- * const agg = bob.minAggregation('min_price').script(
- * bob.script('file', 'my_script').params({ field: 'price' })
+ * const agg = esb.minAggregation('min_price').script(
+ * esb.script('file', 'my_script').params({ field: 'price' })
* );
*
* @example
* // Value script to apply the conversion rate to every value
* // before it is aggregated
- * const agg = bob.minAggregation('min_price').script(
- * bob.script('inline', '_value * params.conversion_rate').params({
+ * const agg = esb.minAggregation('min_price').script(
+ * esb.script('inline', '_value * params.conversion_rate').params({
* conversion_rate: 1.2
* })
* );
diff --git a/src/aggregations/metrics-aggregations/percentile-ranks-aggregation.js b/src/aggregations/metrics-aggregations/percentile-ranks-aggregation.js
index 1898f7d6..2ec103f3 100644
--- a/src/aggregations/metrics-aggregations/percentile-ranks-aggregation.js
+++ b/src/aggregations/metrics-aggregations/percentile-ranks-aggregation.js
@@ -21,7 +21,7 @@ const ES_REF_URL =
* extracted from the aggregated documents.
*
* @example
- * const agg = bob.percentileRanksAggregation(
+ * const agg = esb.percentileRanksAggregation(
* 'load_time_outlier',
* 'load_time',
* [15, 30]
@@ -29,10 +29,10 @@ const ES_REF_URL =
*
* @example
* // Convert load time from mills to seconds on-the-fly using script
- * const agg = bob.percentileRanksAggregation('load_time_outlier')
+ * const agg = esb.percentileRanksAggregation('load_time_outlier')
* .values([3, 5])
* .script(
- * bob.script('inline', "doc['load_time'].value / params.timeUnit")
+ * esb.script('inline', "doc['load_time'].value / params.timeUnit")
* .lang('painless')
* .params({ timeUnit: 1000 })
* );
@@ -71,7 +71,7 @@ class PercentileRanksAggregation extends MetricsAggregationBase {
*
* @example
* // Return the ranges as an array rather than a hash
- * const agg = bob.percentileRanksAggregation('balance_outlier', 'balance')
+ * const agg = esb.percentileRanksAggregation('balance_outlier', 'balance')
* .values([25000, 50000])
* .keyed(false);
*
@@ -140,7 +140,7 @@ class PercentileRanksAggregation extends MetricsAggregationBase {
* The HDR Histogram can be used by specifying the method parameter in the request.
*
* @example
- * const agg = bob.percentileRanksAggregation(
+ * const agg = esb.percentileRanksAggregation(
* 'load_time_outlier',
* 'load_time',
* [15, 30]
diff --git a/src/aggregations/metrics-aggregations/percentiles-aggregation.js b/src/aggregations/metrics-aggregations/percentiles-aggregation.js
index 72b1df57..3f264754 100644
--- a/src/aggregations/metrics-aggregations/percentiles-aggregation.js
+++ b/src/aggregations/metrics-aggregations/percentiles-aggregation.js
@@ -16,12 +16,12 @@ const MetricsAggregationBase = require('./metrics-aggregation-base');
* extracted from the aggregated documents.
*
* @example
- * const agg = bob.percentilesAggregation('load_time_outlier', 'load_time');
+ * const agg = esb.percentilesAggregation('load_time_outlier', 'load_time');
*
* @example
* // Convert load time from mills to seconds on-the-fly using script
- * const agg = bob.percentilesAggregation('load_time_outlier').script(
- * bob.script('inline', "doc['load_time'].value / params.timeUnit")
+ * const agg = esb.percentilesAggregation('load_time_outlier').script(
+ * esb.script('inline', "doc['load_time'].value / params.timeUnit")
* .lang('painless')
* .params({ timeUnit: 1000 })
* );
@@ -43,7 +43,7 @@ class PercentilesAggregation extends MetricsAggregationBase {
*
* @example
* // Return the ranges as an array rather than a hash
- * const agg = bob.percentilesAggregation('balance_outlier', 'balance').keyed(
+ * const agg = esb.percentilesAggregation('balance_outlier', 'balance').keyed(
* false
* );
*
@@ -61,7 +61,7 @@ class PercentilesAggregation extends MetricsAggregationBase {
*
* @example
* // Specify particular percentiles to calculate
- * const agg = bob.percentilesAggregation(
+ * const agg = esb.percentilesAggregation(
* 'load_time_outlier',
* 'load_time'
* ).percents([95, 99, 99.9]);
@@ -86,7 +86,7 @@ class PercentilesAggregation extends MetricsAggregationBase {
* value is 100.
*
* @example
- * const agg = bob.percentilesAggregation(
+ * const agg = esb.percentilesAggregation(
* 'load_time_outlier',
* 'load_time'
* ).tdigest(200);
@@ -111,7 +111,7 @@ class PercentilesAggregation extends MetricsAggregationBase {
* Alias for `tdigest`
*
* @example
- * const agg = bob.percentilesAggregation(
+ * const agg = esb.percentilesAggregation(
* 'load_time_outlier',
* 'load_time'
* ).compression(200);
@@ -133,7 +133,7 @@ class PercentilesAggregation extends MetricsAggregationBase {
* The HDR Histogram can be used by specifying the method parameter in the request.
*
* @example
- * const agg = bob.percentilesAggregation('load_time_outlier', 'load_time')
+ * const agg = esb.percentilesAggregation('load_time_outlier', 'load_time')
* .percents([95, 99, 99.9])
* .hdr(3);
*
diff --git a/src/aggregations/metrics-aggregations/scripted-metric-aggregation.js b/src/aggregations/metrics-aggregations/scripted-metric-aggregation.js
index 2ae19033..43256479 100644
--- a/src/aggregations/metrics-aggregations/scripted-metric-aggregation.js
+++ b/src/aggregations/metrics-aggregations/scripted-metric-aggregation.js
@@ -14,7 +14,7 @@ const ES_REF_URL =
* values extracted from the aggregated documents.
*
* @example
- * const agg = bob.scriptedMetricAggregation('profit')
+ * const agg = esb.scriptedMetricAggregation('profit')
* .initScript('params._agg.transactions = []')
* .mapScript(
* "params._agg.transactions.add(doc.type.value == 'sale' ? doc.amount.value : -1 * doc.amount.value)"
@@ -28,15 +28,15 @@ const ES_REF_URL =
*
* @example
* // Specify using file scripts
- * const agg = bob.scriptedMetricAggregation('profit')
- * .initScript(bob.script('file', 'my_init_script'))
- * .mapScript(bob.script('file', 'my_map_script'))
- * .combineScript(bob.script('file', 'my_combine_script'))
+ * const agg = esb.scriptedMetricAggregation('profit')
+ * .initScript(esb.script('file', 'my_init_script'))
+ * .mapScript(esb.script('file', 'my_map_script'))
+ * .combineScript(esb.script('file', 'my_combine_script'))
* // script parameters for `init`, `map` and `combine` scripts must be
* // specified in a global params object so that
* // it can be shared between the scripts
* .params({ field: 'amount', _agg: {} })
- * .reduceScript(bob.script('file', 'my_reduce_script'));
+ * .reduceScript(esb.script('file', 'my_reduce_script'));
*
* @param {string} name The name which will be used to refer to this aggregation.
*
diff --git a/src/aggregations/metrics-aggregations/stats-aggregation.js b/src/aggregations/metrics-aggregations/stats-aggregation.js
index 647bf58b..6643e2fb 100644
--- a/src/aggregations/metrics-aggregations/stats-aggregation.js
+++ b/src/aggregations/metrics-aggregations/stats-aggregation.js
@@ -16,20 +16,20 @@ const MetricsAggregationBase = require('./metrics-aggregation-base');
* aggregated documents.
*
* @example
- * const agg = bob.statsAggregation('grades_stats', 'grade');
+ * const agg = esb.statsAggregation('grades_stats', 'grade');
*
*
* @example
* // Use a file script
- * const agg = bob.statsAggregation('grades_stats').script(
- * bob.script('file', 'my_script').params({ field: 'price' })
+ * const agg = esb.statsAggregation('grades_stats').script(
+ * esb.script('file', 'my_script').params({ field: 'price' })
* );
*
* @example
* // Value script to apply the conversion rate to every value
* // before it is aggregated
- * const agg = bob.statsAggregation('grades_stats').script(
- * bob.script('inline', '_value * params.conversion_rate').params({
+ * const agg = esb.statsAggregation('grades_stats').script(
+ * esb.script('inline', '_value * params.conversion_rate').params({
* conversion_rate: 1.2
* })
* );
diff --git a/src/aggregations/metrics-aggregations/sum-aggregation.js b/src/aggregations/metrics-aggregations/sum-aggregation.js
index 31455729..07fc115f 100644
--- a/src/aggregations/metrics-aggregations/sum-aggregation.js
+++ b/src/aggregations/metrics-aggregations/sum-aggregation.js
@@ -14,35 +14,35 @@ const MetricsAggregationBase = require('./metrics-aggregation-base');
* aggregated documents.
*
* @example
- * const reqBody = bob.requestBodySearch()
- * .query(bob.constantScoreQuery(bob.matchQuery('type', 'hat')))
- * .agg(bob.sumAggregation('hat_prices', 'price'));
+ * const reqBody = esb.requestBodySearch()
+ * .query(esb.constantScoreQuery(esb.matchQuery('type', 'hat')))
+ * .agg(esb.sumAggregation('hat_prices', 'price'));
*
* @example
* // Script to fetch the sales price
- * const reqBody = bob.requestBodySearch()
- * .query(bob.constantScoreQuery(bob.matchQuery('type', 'hat')))
+ * const reqBody = esb.requestBodySearch()
+ * .query(esb.constantScoreQuery(esb.matchQuery('type', 'hat')))
* .agg(
- * bob.sumAggregation('hat_prices').script(
- * bob.script('inline', 'doc.price.value')
+ * esb.sumAggregation('hat_prices').script(
+ * esb.script('inline', 'doc.price.value')
* )
* );
*
* @example
* // Access the field value from the script using `_value`
- * const reqBody = bob.requestBodySearch()
- * .query(bob.constantScoreQuery(bob.matchQuery('type', 'hat')))
+ * const reqBody = esb.requestBodySearch()
+ * .query(esb.constantScoreQuery(esb.matchQuery('type', 'hat')))
* .agg(
- * bob.sumAggregation('square_hats', 'price').script(
- * bob.script('inline', '_value * _value')
+ * esb.sumAggregation('square_hats', 'price').script(
+ * esb.script('inline', '_value * _value')
* )
* );
*
* @example
* // Treat documents missing price as if they had a value
- * const reqBody = bob.requestBodySearch()
- * .query(bob.constantScoreQuery(bob.matchQuery('type', 'hat')))
- * .agg(bob.sumAggregation('hat_prices', 'price').missing(100));
+ * const reqBody = esb.requestBodySearch()
+ * .query(esb.constantScoreQuery(esb.matchQuery('type', 'hat')))
+ * .agg(esb.sumAggregation('hat_prices', 'price').missing(100));
*
* @param {string} name The name which will be used to refer to this aggregation.
* @param {string=} field The field to aggregate on
diff --git a/src/aggregations/metrics-aggregations/top-hits-aggregation.js b/src/aggregations/metrics-aggregations/top-hits-aggregation.js
index 9bbaf641..f4a9dddf 100644
--- a/src/aggregations/metrics-aggregations/top-hits-aggregation.js
+++ b/src/aggregations/metrics-aggregations/top-hits-aggregation.js
@@ -21,13 +21,13 @@ const ES_REF_URL =
* aggregated.
*
* @example
- * const reqBody = bob.requestBodySearch()
+ * const reqBody = esb.requestBodySearch()
* .agg(
- * bob.termsAggregation('top_tags', 'type')
+ * esb.termsAggregation('top_tags', 'type')
* .size(3)
* .agg(
- * bob.topHitsAggregation('top_sales_hits')
- * .sort(bob.sort('date', 'desc'))
+ * esb.topHitsAggregation('top_sales_hits')
+ * .sort(esb.sort('date', 'desc'))
* .source({ includes: ['date', 'price'] })
* .size(1)
* )
@@ -37,15 +37,15 @@ const ES_REF_URL =
* @example
* // Field collapsing(logically groups a result set into
* // groups and per group returns top documents)
- * const reqBody = bob.requestBodySearch()
- * .query(bob.matchQuery('body', 'elections'))
+ * const reqBody = esb.requestBodySearch()
+ * .query(esb.matchQuery('body', 'elections'))
* .agg(
- * bob.termsAggregation('top-sites', 'domain')
+ * esb.termsAggregation('top-sites', 'domain')
* .order('top_hit', 'desc')
- * .agg(bob.topHitsAggregation('top_tags_hits'))
+ * .agg(esb.topHitsAggregation('top_tags_hits'))
* .agg(
- * bob.maxAggregation('top_hit').script(
- * bob.script('inline', '_score')
+ * esb.maxAggregation('top_hit').script(
+ * esb.script('inline', '_score')
* )
* )
* );
diff --git a/src/aggregations/metrics-aggregations/value-count-aggregation.js b/src/aggregations/metrics-aggregations/value-count-aggregation.js
index 5b71bce8..1241d3fe 100644
--- a/src/aggregations/metrics-aggregations/value-count-aggregation.js
+++ b/src/aggregations/metrics-aggregations/value-count-aggregation.js
@@ -18,11 +18,11 @@ const ES_REF_URL =
* aggregated documents.
*
* @example
- * const agg = bob.valueCountAggregation('types_count', 'type');
+ * const agg = esb.valueCountAggregation('types_count', 'type');
*
* @example
- * const agg = bob.valueCountAggregation('types_count').script(
- * bob.script('inline', "doc['type'].value")
+ * const agg = esb.valueCountAggregation('types_count').script(
+ * esb.script('inline', "doc['type'].value")
* );
*
* @param {string} name The name which will be used to refer to this aggregation.
diff --git a/src/aggregations/pipeline-aggregations/avg-bucket-aggregation.js b/src/aggregations/pipeline-aggregations/avg-bucket-aggregation.js
index 134b4573..9bc39bd4 100644
--- a/src/aggregations/pipeline-aggregations/avg-bucket-aggregation.js
+++ b/src/aggregations/pipeline-aggregations/avg-bucket-aggregation.js
@@ -13,14 +13,14 @@ const ES_REF_URL =
* [Elasticsearch reference](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-pipeline-avg-bucket-aggregation.html)
*
* @example
- * const reqBody = bob.requestBodySearch()
+ * const reqBody = esb.requestBodySearch()
* .agg(
- * bob.dateHistogramAggregation('sales_per_month', 'date')
+ * esb.dateHistogramAggregation('sales_per_month', 'date')
* .interval('month')
- * .agg(bob.sumAggregation('sales', 'price'))
+ * .agg(esb.sumAggregation('sales', 'price'))
* )
* .agg(
- * bob.avgBucketAggregation(
+ * esb.avgBucketAggregation(
* 'avg_monthly_sales',
* 'sales_per_month>sales'
* )
diff --git a/src/aggregations/pipeline-aggregations/bucket-script-aggregation.js b/src/aggregations/pipeline-aggregations/bucket-script-aggregation.js
index 9a9f6f7b..b31b6d67 100644
--- a/src/aggregations/pipeline-aggregations/bucket-script-aggregation.js
+++ b/src/aggregations/pipeline-aggregations/bucket-script-aggregation.js
@@ -14,17 +14,17 @@ const ES_REF_URL =
* [Elasticsearch reference](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-pipeline-bucket-script-aggregation.html)
*
* @example
- * const reqBody = bob.requestBodySearch()
+ * const reqBody = esb.requestBodySearch()
* .agg(
- * bob.dateHistogramAggregation('sales_per_month', 'date', 'month')
- * .agg(bob.sumAggregation('total_sales', 'price'))
+ * esb.dateHistogramAggregation('sales_per_month', 'date', 'month')
+ * .agg(esb.sumAggregation('total_sales', 'price'))
* .agg(
- * bob.filterAggregation('t-shirts')
- * .filter(bob.termQuery('type', 't-shirt'))
- * .agg(bob.sumAggregation('sales', 'price'))
+ * esb.filterAggregation('t-shirts')
+ * .filter(esb.termQuery('type', 't-shirt'))
+ * .agg(esb.sumAggregation('sales', 'price'))
* )
* .agg(
- * bob.bucketScriptAggregation('t-shirt-percentage')
+ * esb.bucketScriptAggregation('t-shirt-percentage')
* .bucketsPath({
* tShirtSales: 't-shirts>sales',
* totalSales: 'total_sales'
diff --git a/src/aggregations/pipeline-aggregations/bucket-selector-aggregation.js b/src/aggregations/pipeline-aggregations/bucket-selector-aggregation.js
index 8e7890d1..8642f3ff 100644
--- a/src/aggregations/pipeline-aggregations/bucket-selector-aggregation.js
+++ b/src/aggregations/pipeline-aggregations/bucket-selector-aggregation.js
@@ -15,27 +15,27 @@ const ES_REF_URL =
* [Elasticsearch reference](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-pipeline-bucket-selector-aggregation.html)
*
* @example
- * const reqBody = bob.requestBodySearch()
+ * const reqBody = esb.requestBodySearch()
* .agg(
- * bob.dateHistogramAggregation('histo', 'date')
+ * esb.dateHistogramAggregation('histo', 'date')
* .interval('day')
- * .agg(bob.termsAggregation('categories', 'category'))
+ * .agg(esb.termsAggregation('categories', 'category'))
* .agg(
- * bob.bucketSelectorAggregation('min_bucket_selector')
+ * esb.bucketSelectorAggregation('min_bucket_selector')
* .bucketsPath({ count: 'categories._bucket_count' })
- * .script(bob.script('inline', 'params.count != 0'))
+ * .script(esb.script('inline', 'params.count != 0'))
* )
* )
* .size(0);
*
* @example
- * const reqBody = bob.requestBodySearch()
+ * const reqBody = esb.requestBodySearch()
* .agg(
- * bob.dateHistogramAggregation('sales_per_month', 'date')
+ * esb.dateHistogramAggregation('sales_per_month', 'date')
* .interval('month')
- * .agg(bob.sumAggregation('sales', 'price'))
+ * .agg(esb.sumAggregation('sales', 'price'))
* .agg(
- * bob.bucketSelectorAggregation('sales_bucket_filter')
+ * esb.bucketSelectorAggregation('sales_bucket_filter')
* .bucketsPath({ totalSales: 'total_sales' })
* .script('params.totalSales > 200')
* )
diff --git a/src/aggregations/pipeline-aggregations/cumulative-sum-aggregation.js b/src/aggregations/pipeline-aggregations/cumulative-sum-aggregation.js
index 9614f80c..28bfe602 100644
--- a/src/aggregations/pipeline-aggregations/cumulative-sum-aggregation.js
+++ b/src/aggregations/pipeline-aggregations/cumulative-sum-aggregation.js
@@ -14,11 +14,11 @@ const ES_REF_URL =
* [Elasticsearch reference](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-pipeline-cumulative-sum-aggregation.html)
*
* @example
- * const reqBody = bob.requestBodySearch()
+ * const reqBody = esb.requestBodySearch()
* .agg(
- * bob.dateHistogramAggregation('sales_per_month', 'date', 'month')
- * .agg(bob.sumAggregation('sales', 'price'))
- * .agg(bob.cumulativeSumAggregation('cumulative_sales', 'sales'))
+ * esb.dateHistogramAggregation('sales_per_month', 'date', 'month')
+ * .agg(esb.sumAggregation('sales', 'price'))
+ * .agg(esb.cumulativeSumAggregation('cumulative_sales', 'sales'))
* )
* .size(0);
*
diff --git a/src/aggregations/pipeline-aggregations/derivative-aggregation.js b/src/aggregations/pipeline-aggregations/derivative-aggregation.js
index 65fdbb55..c5704803 100644
--- a/src/aggregations/pipeline-aggregations/derivative-aggregation.js
+++ b/src/aggregations/pipeline-aggregations/derivative-aggregation.js
@@ -14,24 +14,24 @@ const ES_REF_URL =
* [Elasticsearch reference](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-pipeline-derivative-aggregation.html)
*
* @example
- * const reqBody = bob.requestBodySearch()
+ * const reqBody = esb.requestBodySearch()
* .agg(
- * bob.dateHistogramAggregation('sales_per_month', 'date')
+ * esb.dateHistogramAggregation('sales_per_month', 'date')
* .interval('month')
- * .agg(bob.sumAggregation('sales', 'price'))
- * .agg(bob.derivativeAggregation('sales_deriv', 'sales'))
+ * .agg(esb.sumAggregation('sales', 'price'))
+ * .agg(esb.derivativeAggregation('sales_deriv', 'sales'))
* )
* .size(0);
*
* @example
* // First and second order derivative of the monthly sales
- * const reqBody = bob.requestBodySearch()
+ * const reqBody = esb.requestBodySearch()
* .agg(
- * bob.dateHistogramAggregation('sales_per_month', 'date')
+ * esb.dateHistogramAggregation('sales_per_month', 'date')
* .interval('month')
- * .agg(bob.sumAggregation('sales', 'price'))
- * .agg(bob.derivativeAggregation('sales_deriv', 'sales'))
- * .agg(bob.derivativeAggregation('sales_2nd_deriv', 'sales_deriv'))
+ * .agg(esb.sumAggregation('sales', 'price'))
+ * .agg(esb.derivativeAggregation('sales_deriv', 'sales'))
+ * .agg(esb.derivativeAggregation('sales_2nd_deriv', 'sales_deriv'))
* )
* .size(0);
*
@@ -51,12 +51,12 @@ class DerivativeAggregation extends PipelineAggregationBase {
* the x-axis of the derivative calculation
*
* @example
- * const reqBody = bob.requestBodySearch()
+ * const reqBody = esb.requestBodySearch()
* .agg(
- * bob.dateHistogramAggregation('sales_per_month', 'date')
+ * esb.dateHistogramAggregation('sales_per_month', 'date')
* .interval('month')
- * .agg(bob.sumAggregation('sales', 'price'))
- * .agg(bob.derivativeAggregation('sales_deriv', 'sales').unit('day'))
+ * .agg(esb.sumAggregation('sales', 'price'))
+ * .agg(esb.derivativeAggregation('sales_deriv', 'sales').unit('day'))
* )
* .size(0);
*
diff --git a/src/aggregations/pipeline-aggregations/extended-stats-bucket-aggregation.js b/src/aggregations/pipeline-aggregations/extended-stats-bucket-aggregation.js
index 22eb2338..eabf3d5c 100644
--- a/src/aggregations/pipeline-aggregations/extended-stats-bucket-aggregation.js
+++ b/src/aggregations/pipeline-aggregations/extended-stats-bucket-aggregation.js
@@ -14,15 +14,15 @@ const ES_REF_URL =
* [Elasticsearch reference](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-pipeline-extended-stats-bucket-aggregation.html)
*
* @example
- * const reqBody = bob.requestBodySearch()
+ * const reqBody = esb.requestBodySearch()
* .agg(
- * bob.dateHistogramAggregation('sales_per_month', 'date')
+ * esb.dateHistogramAggregation('sales_per_month', 'date')
* .interval('month')
- * .agg(bob.sumAggregation('sales', 'price'))
+ * .agg(esb.sumAggregation('sales', 'price'))
* )
* .agg(
* // Calculates extended stats for monthly sales
- * bob.extendedStatsBucketAggregation(
+ * esb.extendedStatsBucketAggregation(
* 'stats_monthly_sales',
* 'sales_per_month>sales'
* )
diff --git a/src/aggregations/pipeline-aggregations/max-bucket-aggregation.js b/src/aggregations/pipeline-aggregations/max-bucket-aggregation.js
index 0ae89c9c..e167e24d 100644
--- a/src/aggregations/pipeline-aggregations/max-bucket-aggregation.js
+++ b/src/aggregations/pipeline-aggregations/max-bucket-aggregation.js
@@ -15,17 +15,17 @@ const ES_REF_URL =
* [Elasticsearch reference](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-pipeline-max-bucket-aggregation.html)
*
* @example
- * const reqBody = bob.requestBodySearch()
+ * const reqBody = esb.requestBodySearch()
* .agg(
- * bob.dateHistogramAggregation('sales_per_month', 'date')
+ * esb.dateHistogramAggregation('sales_per_month', 'date')
* .interval('month')
- * .agg(bob.sumAggregation('sales', 'price'))
+ * .agg(esb.sumAggregation('sales', 'price'))
* )
* .agg(
* // Metric embedded in sibling aggregation
* // Get the maximum value of `sales` aggregation in
* // `sales_per_month` histogram
- * bob.maxBucketAggregation(
+ * esb.maxBucketAggregation(
* 'max_monthly_sales',
* 'sales_per_month>sales'
* )
diff --git a/src/aggregations/pipeline-aggregations/min-bucket-aggregation.js b/src/aggregations/pipeline-aggregations/min-bucket-aggregation.js
index 8a83c48a..d2fe8761 100644
--- a/src/aggregations/pipeline-aggregations/min-bucket-aggregation.js
+++ b/src/aggregations/pipeline-aggregations/min-bucket-aggregation.js
@@ -15,17 +15,17 @@ const ES_REF_URL =
* [Elasticsearch reference](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-pipeline-min-bucket-aggregation.html)
*
* @example
- * const reqBody = bob.requestBodySearch()
+ * const reqBody = esb.requestBodySearch()
* .agg(
- * bob.dateHistogramAggregation('sales_per_month', 'date')
+ * esb.dateHistogramAggregation('sales_per_month', 'date')
* .interval('month')
- * .agg(bob.sumAggregation('sales', 'price'))
+ * .agg(esb.sumAggregation('sales', 'price'))
* )
* .agg(
* // Metric embedded in sibling aggregation
* // Get the minimum value of `sales` aggregation in
* // `sales_per_month` histogram
- * bob.minBucketAggregation(
+ * esb.minBucketAggregation(
* 'min_monthly_sales',
* 'sales_per_month>sales'
* )
diff --git a/src/aggregations/pipeline-aggregations/moving-average-aggregation.js b/src/aggregations/pipeline-aggregations/moving-average-aggregation.js
index 4e0db36d..5d6abbb8 100644
--- a/src/aggregations/pipeline-aggregations/moving-average-aggregation.js
+++ b/src/aggregations/pipeline-aggregations/moving-average-aggregation.js
@@ -21,30 +21,30 @@ const invalidModelParam = invalidParam(ES_REF_URL, 'model', MODEL_SET);
* [Elasticsearch reference](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-pipeline-movavg-aggregation.html)
*
* @example
- * const agg = bob.movingAverageAggregation('the_movavg', 'the_sum')
+ * const agg = esb.movingAverageAggregation('the_movavg', 'the_sum')
* .model('holt')
* .window(5)
* .gapPolicy('insert_zeros')
* .settings({ alpha: 0.8 });
*
* @example
- * const reqBody = bob.requestBodySearch()
+ * const reqBody = esb.requestBodySearch()
* .agg(
- * bob.dateHistogramAggregation('my_date_histo', 'timestamp')
+ * esb.dateHistogramAggregation('my_date_histo', 'timestamp')
* .interval('day')
- * .agg(bob.sumAggregation('the_sum', 'lemmings'))
+ * .agg(esb.sumAggregation('the_sum', 'lemmings'))
* // Relative path to sibling metric `the_sum`
- * .agg(bob.movingAverageAggregation('the_movavg', 'the_sum'))
+ * .agg(esb.movingAverageAggregation('the_movavg', 'the_sum'))
* )
* .size(0);
*
* @example
- * const reqBody = bob.requestBodySearch()
+ * const reqBody = esb.requestBodySearch()
* .agg(
- * bob.dateHistogramAggregation('my_date_histo', 'timestamp')
+ * esb.dateHistogramAggregation('my_date_histo', 'timestamp')
* .interval('day')
* // Use the document count as it's input
- * .agg(bob.movingAverageAggregation('the_movavg', '_count'))
+ * .agg(esb.movingAverageAggregation('the_movavg', '_count'))
* )
* .size(0);
*
@@ -72,12 +72,12 @@ class MovingAverageAggregation extends PipelineAggregationBase {
* Sets the moving average weighting model that we wish to use. Optional.
*
* @example
- * const agg = bob.movingAverageAggregation('the_movavg', 'the_sum')
+ * const agg = esb.movingAverageAggregation('the_movavg', 'the_sum')
* .model('simple')
* .window(30);
*
* @example
- * const agg = bob.movingAverageAggregation('the_movavg', 'the_sum')
+ * const agg = esb.movingAverageAggregation('the_movavg', 'the_sum')
* .model('ewma')
* .window(30)
* .settings({ alpha: 0.8 });
@@ -102,7 +102,7 @@ class MovingAverageAggregation extends PipelineAggregationBase {
* Sets the size of window to "slide" across the histogram. Optional.
*
* @example
- * const agg = bob.movingAverageAggregation('the_movavg', 'the_sum')
+ * const agg = esb.movingAverageAggregation('the_movavg', 'the_sum')
* .model('simple')
* .window(30)
*
@@ -121,7 +121,7 @@ class MovingAverageAggregation extends PipelineAggregationBase {
* while it is enabled by default for `holt_winters`.
*
* @example
- * const agg = bob.movingAverageAggregation('the_movavg', 'the_sum')
+ * const agg = esb.movingAverageAggregation('the_movavg', 'the_sum')
* .model('holt_winters')
* .window(30)
* .minimize(true)
@@ -140,7 +140,7 @@ class MovingAverageAggregation extends PipelineAggregationBase {
* Optional.
*
* @example
- * const agg = bob.movingAverageAggregation('the_movavg', 'the_sum')
+ * const agg = esb.movingAverageAggregation('the_movavg', 'the_sum')
* .model('ewma')
* .window(30)
* .settings({ alpha: 0.8 });
@@ -158,7 +158,7 @@ class MovingAverageAggregation extends PipelineAggregationBase {
* the current smoothed, moving average
*
* @example
- * const agg = bob.movingAverageAggregation('the_movavg', 'the_sum')
+ * const agg = esb.movingAverageAggregation('the_movavg', 'the_sum')
* .model('simple')
* .window(30)
* .predict(10);
diff --git a/src/aggregations/pipeline-aggregations/percentiles-bucket-aggregation.js b/src/aggregations/pipeline-aggregations/percentiles-bucket-aggregation.js
index f28e4dc2..00def0ce 100644
--- a/src/aggregations/pipeline-aggregations/percentiles-bucket-aggregation.js
+++ b/src/aggregations/pipeline-aggregations/percentiles-bucket-aggregation.js
@@ -16,15 +16,15 @@ const ES_REF_URL =
* [Elasticsearch reference](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-pipeline-percentiles-bucket-aggregation.html)
*
* @example
- * const reqBody = bob.requestBodySearch()
+ * const reqBody = esb.requestBodySearch()
* .agg(
- * bob.dateHistogramAggregation('sales_per_month', 'date')
+ * esb.dateHistogramAggregation('sales_per_month', 'date')
* .interval('month')
- * .agg(bob.sumAggregation('sales', 'price'))
+ * .agg(esb.sumAggregation('sales', 'price'))
* )
* .agg(
* // Calculates stats for monthly sales
- * bob.percentilesBucketAggregation(
+ * esb.percentilesBucketAggregation(
* 'percentiles_monthly_sales',
* 'sales_per_month>sales'
* ).percents([25.0, 50.0, 75.0])
diff --git a/src/aggregations/pipeline-aggregations/pipeline-aggregation-base.js b/src/aggregations/pipeline-aggregations/pipeline-aggregation-base.js
index eeb6332a..6fe122f2 100644
--- a/src/aggregations/pipeline-aggregations/pipeline-aggregation-base.js
+++ b/src/aggregations/pipeline-aggregations/pipeline-aggregation-base.js
@@ -47,15 +47,15 @@ class PipelineAggregationBase extends Aggregation {
* [Elasticsearch reference](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-pipeline.html#buckets-path-syntax)
*
* @example
- * const reqBody = bob.requestBodySearch()
+ * const reqBody = esb.requestBodySearch()
* .agg(
- * bob.dateHistogramAggregation('histo', 'date')
+ * esb.dateHistogramAggregation('histo', 'date')
* .interval('day')
- * .agg(bob.termsAggregation('categories', 'category'))
+ * .agg(esb.termsAggregation('categories', 'category'))
* .agg(
- * bob.bucketSelectorAggregation('min_bucket_selector')
+ * esb.bucketSelectorAggregation('min_bucket_selector')
* .bucketsPath({ count: 'categories._bucket_count' })
- * .script(bob.script('inline', 'params.count != 0'))
+ * .script(esb.script('inline', 'params.count != 0'))
* )
* )
* .size(0);
diff --git a/src/aggregations/pipeline-aggregations/serial-differencing-aggregation.js b/src/aggregations/pipeline-aggregations/serial-differencing-aggregation.js
index f0830346..0600a51e 100644
--- a/src/aggregations/pipeline-aggregations/serial-differencing-aggregation.js
+++ b/src/aggregations/pipeline-aggregations/serial-differencing-aggregation.js
@@ -14,13 +14,13 @@ const ES_REF_URL =
* [Elasticsearch reference](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-pipeline-serialdiff-aggregation.html)
*
* @example
- * const reqBody = bob.requestBodySearch()
+ * const reqBody = esb.requestBodySearch()
* .agg(
- * bob.dateHistogramAggregation('my_date_histo', 'timestamp')
+ * esb.dateHistogramAggregation('my_date_histo', 'timestamp')
* .interval('day')
- * .agg(bob.sumAggregation('the_sum', 'lemmings'))
+ * .agg(esb.sumAggregation('the_sum', 'lemmings'))
* .agg(
- * bob.serialDifferencingAggregation(
+ * esb.serialDifferencingAggregation(
* 'thirtieth_difference',
* 'the_sum'
* ).lag(30)
diff --git a/src/aggregations/pipeline-aggregations/stats-bucket-aggregation.js b/src/aggregations/pipeline-aggregations/stats-bucket-aggregation.js
index f770fccc..d791368a 100644
--- a/src/aggregations/pipeline-aggregations/stats-bucket-aggregation.js
+++ b/src/aggregations/pipeline-aggregations/stats-bucket-aggregation.js
@@ -14,15 +14,15 @@ const ES_REF_URL =
* [Elasticsearch reference](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-pipeline-stats-bucket-aggregation.html)
*
* @example
- * const reqBody = bob.requestBodySearch()
+ * const reqBody = esb.requestBodySearch()
* .agg(
- * bob.dateHistogramAggregation('sales_per_month', 'date')
+ * esb.dateHistogramAggregation('sales_per_month', 'date')
* .interval('month')
- * .agg(bob.sumAggregation('sales', 'price'))
+ * .agg(esb.sumAggregation('sales', 'price'))
* )
* .agg(
* // Calculates stats for monthly sales
- * bob.statsBucketAggregation(
+ * esb.statsBucketAggregation(
* 'stats_monthly_sales',
* 'sales_per_month>sales'
* )
diff --git a/src/aggregations/pipeline-aggregations/sum-bucket-aggregation.js b/src/aggregations/pipeline-aggregations/sum-bucket-aggregation.js
index 129c9156..d6069bef 100644
--- a/src/aggregations/pipeline-aggregations/sum-bucket-aggregation.js
+++ b/src/aggregations/pipeline-aggregations/sum-bucket-aggregation.js
@@ -16,15 +16,15 @@ const ES_REF_URL =
* @param {string=} bucketsPath The relative path of metric to aggregate over
*
* @example
- * const reqBody = bob.requestBodySearch()
+ * const reqBody = esb.requestBodySearch()
* .agg(
- * bob.dateHistogramAggregation('sales_per_month', 'date')
+ * esb.dateHistogramAggregation('sales_per_month', 'date')
* .interval('month')
- * .agg(bob.sumAggregation('sales', 'price'))
+ * .agg(esb.sumAggregation('sales', 'price'))
* )
* .agg(
* // Get the sum of all the total monthly `sales` buckets
- * bob.sumBucketAggregation(
+ * esb.sumBucketAggregation(
* 'sum_monthly_sales',
* 'sales_per_month>sales'
* )
diff --git a/src/core/geo-shape.js b/src/core/geo-shape.js
index 72885602..178400a5 100644
--- a/src/core/geo-shape.js
+++ b/src/core/geo-shape.js
@@ -19,13 +19,13 @@ const invalidTypeParam = invalidParam(ES_REF_URL, 'type', GEO_SHAPE_TYPES);
*
* @example
* // Pass options using method
- * const shape = bob.geoShape()
+ * const shape = esb.geoShape()
* .type('linestring')
* .coordinates([[-77.03653, 38.897676], [-77.009051, 38.889939]]);
*
* @example
* // Pass parameters using contructor
- * const shape = bob.geoShape('multipoint', [[102.0, 2.0], [103.0, 2.0]])
+ * const shape = esb.geoShape('multipoint', [[102.0, 2.0], [103.0, 2.0]])
*
* @param {string=} type A valid shape type.
* Can be one of `point`, `linestring`, `polygon`, `multipoint`, `multilinestring`,
@@ -45,7 +45,7 @@ class GeoShape {
* Sets the GeoJSON format type used to represent shape.
*
* @example
- * const shape = bob.geoShape()
+ * const shape = esb.geoShape()
* .type('envelope')
* .coordinates([[-45.0, 45.0], [45.0, -45.0]])
*
@@ -70,7 +70,7 @@ class GeoShape {
* and [ElasticSearch documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/geo-shape.html#input-structure) for correct coordinate definitions.
*
* @example
- * const shape = bob.geoShape()
+ * const shape = esb.geoShape()
* .type('point')
* .coordinates([-77.03653, 38.897676])
*
@@ -88,7 +88,7 @@ class GeoShape {
* Sets the radius for parsing a circle `GeoShape`.
*
* @example
- * const shape = bob.geoShape()
+ * const shape = esb.geoShape()
* .type('circle')
* .coordinates([-45.0, 45.0])
* .radius('100m')
diff --git a/src/core/highlight.js b/src/core/highlight.js
index 1b7e3274..b194c252 100644
--- a/src/core/highlight.js
+++ b/src/core/highlight.js
@@ -43,12 +43,12 @@ const invalidFragmenterParam = invalidParam(
* [Elasticsearch reference](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-highlighting.html)
*
* @example
- * const reqBody = bob.requestBodySearch()
- * .query(bob.matchAllQuery())
- * .highlight(bob.highlight('content'));
+ * const reqBody = esb.requestBodySearch()
+ * .query(esb.matchAllQuery())
+ * .highlight(esb.highlight('content'));
*
* @example
- * const highlight = bob.highlight()
+ * const highlight = esb.highlight()
* .numberOfFragments(3)
* .fragmentSize(150)
* .fields(['_all', 'bio.title', 'bio.author', 'bio.content'])
@@ -139,12 +139,12 @@ class Highlight {
* tags to a specific field by passing the optional field name parameter.
*
* @example
- * const highlight = bob.highlight('_all')
+ * const highlight = esb.highlight('_all')
* .preTags('')
* .postTags('');
*
* @example
- * const highlight = bob.highlight('_all')
+ * const highlight = esb.highlight('_all')
* .preTags(['', ''])
* .postTags(['', '']);
*
@@ -162,12 +162,12 @@ class Highlight {
* tags to a specific field by passing the optional field name parameter.
*
* @example
- * const highlight = bob.highlight('_all')
+ * const highlight = esb.highlight('_all')
* .preTags('')
* .postTags('');
*
* @example
- * const highlight = bob.highlight('_all')
+ * const highlight = esb.highlight('_all')
* .preTags(['', ''])
* .postTags(['', '']);
*
@@ -190,7 +190,7 @@ class Highlight {
* styled - 10 `` pre tags with css class of hltN, where N is 1-10
*
* @example
- * const highlight = bob.highlight('content').styledTagsSchema();
+ * const highlight = esb.highlight('content').styledTagsSchema();
*
* @returns {Highlight} returns `this` so that calls can be chained
*/
@@ -206,7 +206,7 @@ class Highlight {
* score order to a specific field by passing the optional field name parameter.
*
* @example
- * const highlight = bob.highlight('content').scoreOrder()
+ * const highlight = esb.highlight('content').scoreOrder()
*
* @param {string=} field An optional field name
* @returns {Highlight} returns `this` so that calls can be chained
@@ -223,7 +223,7 @@ class Highlight {
* option to a specific field by passing the optional field name parameter.
*
* @example
- * const highlight = bob.highlight('content')
+ * const highlight = esb.highlight('content')
* .fragmentSize(150, 'content')
* .numberOfFragments(3, 'content');
*
@@ -240,12 +240,12 @@ class Highlight {
* option to a specific field by passing the optional field name parameter.
*
* @example
- * const highlight = bob.highlight('content')
+ * const highlight = esb.highlight('content')
* .fragmentSize(150, 'content')
* .numberOfFragments(3, 'content');
*
* @example
- * const highlight = bob.highlight(['_all', 'bio.title'])
+ * const highlight = esb.highlight(['_all', 'bio.title'])
* .numberOfFragments(0, 'bio.title');
*
* @param {number} count The maximum number of fragments to return
@@ -267,7 +267,7 @@ class Highlight {
* Default is `0`.
*
* @example
- * const highlight = bob.highlight('content')
+ * const highlight = esb.highlight('content')
* .fragmentSize(150, 'content')
* .numberOfFragments(3, 'content')
* .noMatchSize(150, 'content');
@@ -287,14 +287,14 @@ class Highlight {
* are not taken into account by highlighting by default.
*
* @example
- * const highlight = bob.highlight('content')
+ * const highlight = esb.highlight('content')
* .fragmentSize(150, 'content')
* .numberOfFragments(3, 'content')
* .highlightQuery(
- * bob.boolQuery()
- * .must(bob.matchQuery('content', 'foo bar'))
+ * esb.boolQuery()
+ * .must(esb.matchQuery('content', 'foo bar'))
* .should(
- * bob.matchPhraseQuery('content', 'foo bar').slop(1).boost(10)
+ * esb.matchPhraseQuery('content', 'foo bar').slop(1).boost(10)
* )
* .minimumShouldMatch(0),
* 'content'
@@ -318,7 +318,7 @@ class Highlight {
* Sets the highlight type to Fast Vector Highlighter(`fvh`).
*
* @example
- * const highlight = bob.highlight('content')
+ * const highlight = esb.highlight('content')
* .scoreOrder('content')
* .matchedFields(['content', 'content.plain'], 'content');
*
@@ -396,7 +396,7 @@ class Highlight {
* option to a specific field by passing the optional field name parameter.
*
* @example
- * const highlight = bob.highlight('_all')
+ * const highlight = esb.highlight('_all')
* .preTags('', '_all')
* .postTags('', '_all')
* .requireFieldMatch(false);
@@ -450,7 +450,7 @@ class Highlight {
* `index_options` is set to `offsets`.
*
* @example
- * const highlight = bob.highlight('content').type('plain', 'content');
+ * const highlight = esb.highlight('content').type('plain', 'content');
*
* @param {string} type The allowed values are: `plain`, `postings` and `fvh`.
* @param {string=} field An optional field name
@@ -478,7 +478,7 @@ class Highlight {
* even if fields are stored separately. Defaults to false.
*
* @example
- * const highlight = bob.highlight('content').forceSource(true, 'content');
+ * const highlight = esb.highlight('content').forceSource(true, 'content');
*
* @param {boolean} forceSource
* @param {string=} field An optional field name
@@ -499,7 +499,7 @@ class Highlight {
* up Spans.
*
* @example
- * const highlight = bob.highlight('message')
+ * const highlight = esb.highlight('message')
* .fragmentSize(15, 'message')
* .numberOfFragments(3, 'message')
* .fragmenter('simple', 'message');
diff --git a/src/core/indexed-shape.js b/src/core/indexed-shape.js
index f8c97f31..9e19a347 100644
--- a/src/core/indexed-shape.js
+++ b/src/core/indexed-shape.js
@@ -10,11 +10,11 @@ const isNil = require('lodash.isnil');
* provide their coordinates each time.
*
* @example
- * const shape = bob.indexedShape('DEU', 'countries')
+ * const shape = esb.indexedShape('DEU', 'countries')
* .index('shapes')
* .path('location');
*
- * const shape = bob.indexedShape()
+ * const shape = esb.indexedShape()
* .id('DEU')
* .type('countries')
* .index('shapes')
diff --git a/src/core/inner-hits.js b/src/core/inner-hits.js
index 2175c1f0..95213044 100644
--- a/src/core/inner-hits.js
+++ b/src/core/inner-hits.js
@@ -16,11 +16,11 @@ const { checkType, setDefault, recursiveToJSON } = require('./util');
* [Elasticsearch reference](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-inner-hits.html)
*
* @example
- * const reqBody = bob.requestBodySearch().query(
- * bob.nestedQuery(
- * bob.matchQuery('comments.message', '[actual query]')
+ * const reqBody = esb.requestBodySearch().query(
+ * esb.nestedQuery(
+ * esb.matchQuery('comments.message', '[actual query]')
* ).innerHits(
- * bob.innerHits().source(false).storedFields(['comments.text'])
+ * esb.innerHits().source(false).storedFields(['comments.text'])
* )
* );
*
diff --git a/src/core/query.js b/src/core/query.js
index 3a2856ec..d30f8d9a 100644
--- a/src/core/query.js
+++ b/src/core/query.js
@@ -36,12 +36,12 @@ class Query {
* Sets the query name.
*
* @example
- * const boolQry = bob.boolQuery()
+ * const boolQry = esb.boolQuery()
* .should([
- * bob.matchQuery('name.first', 'shay').name('first'),
- * bob.matchQuery('name.last', 'banon').name('last')
+ * esb.matchQuery('name.first', 'shay').name('first'),
+ * esb.matchQuery('name.last', 'banon').name('last')
* ])
- * .filter(bob.termsQuery('name.last', ['banon', 'kimchy']).name('test'));
+ * .filter(esb.termsQuery('name.last', ['banon', 'kimchy']).name('test'));
*
* @param {string} name
* @returns {Query} returns `this` so that calls can be chained.
diff --git a/src/core/request-body-search.js b/src/core/request-body-search.js
index 987a9e9b..eebe43c0 100644
--- a/src/core/request-body-search.js
+++ b/src/core/request-body-search.js
@@ -34,8 +34,8 @@ function recMerge(arr) {
* [Elasticsearch reference](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-body.html)
*
* @example
- * const reqBody = bob.requestBodySearch()
- * .query(bob.termQuery('user', 'kimchy'))
+ * const reqBody = esb.requestBodySearch()
+ * .query(esb.termQuery('user', 'kimchy'))
* .from(0)
* .size(10);
*
@@ -48,19 +48,19 @@ function recMerge(arr) {
*
* @example
* // Query and aggregation
- * const reqBody = bob.requestBodySearch()
- * .query(bob.matchQuery('business_type', 'shop'))
+ * const reqBody = esb.requestBodySearch()
+ * .query(esb.matchQuery('business_type', 'shop'))
* .agg(
- * bob.geoBoundsAggregation('viewport', 'location').wrapLongitude(true)
+ * esb.geoBoundsAggregation('viewport', 'location').wrapLongitude(true)
* );
*
* @example
* // Query, aggregation with nested
- * const reqBody = bob.requestBodySearch()
- * .query(bob.matchQuery('crime', 'burglary'))
+ * const reqBody = esb.requestBodySearch()
+ * .query(esb.matchQuery('crime', 'burglary'))
* .agg(
- * bob.termsAggregation('towns', 'town').agg(
- * bob.geoCentroidAggregation('centroid', 'location')
+ * esb.termsAggregation('towns', 'town').agg(
+ * esb.geoCentroidAggregation('centroid', 'location')
* )
* );
*/
@@ -147,10 +147,10 @@ class RequestBodySearch {
* Sets suggester on the request body.
*
* @example
- * const req = bob.requestBodySearch()
- * .query(bob.matchQuery('message', 'trying out elasticsearch'))
+ * const req = esb.requestBodySearch()
+ * .query(esb.matchQuery('message', 'trying out elasticsearch'))
* .suggest(
- * bob.termSuggester(
+ * esb.termSuggester(
* 'my-suggestion',
* 'message',
* 'tring out Elasticsearch'
@@ -172,10 +172,10 @@ class RequestBodySearch {
* Sets the global suggest text to avoid repetition for multiple suggestions.
*
* @example
- * const req = bob.requestBodySearch()
+ * const req = esb.requestBodySearch()
* .suggestText('tring out elasticsearch')
- * .suggest(bob.termSuggester('my-suggest-1', 'message'))
- * .suggest(bob.termSuggester('my-suggest-2', 'user'));
+ * .suggest(esb.termSuggester('my-suggest-1', 'message'))
+ * .suggest(esb.termSuggester('my-suggest-2', 'user'));
*
* @param {string} txt Global suggest text
* @returns {RequestBodySearch} returns `this` so that calls can be chained.
@@ -245,14 +245,14 @@ class RequestBodySearch {
* sort by score, and `_doc` to sort by index order.
*
* @example
- * const reqBody = bob.requestBodySearch()
- * .query(bob.termQuery('user', 'kimchy'))
- * .sort(bob.sort('post_date', 'asc'))
- * .sort(bob.sort('user'))
+ * const reqBody = esb.requestBodySearch()
+ * .query(esb.termQuery('user', 'kimchy'))
+ * .sort(esb.sort('post_date', 'asc'))
+ * .sort(esb.sort('user'))
* .sorts([
- * bob.sort('name', 'desc'),
- * bob.sort('age', 'desc'),
- * bob.sort('_score')
+ * esb.sort('name', 'desc'),
+ * esb.sort('age', 'desc'),
+ * esb.sort('_score')
* ]);
*
* @param {Sort} sort
@@ -273,14 +273,14 @@ class RequestBodySearch {
* sort by score, and _doc to sort by index order.
*
* @example
- * const reqBody = bob.requestBodySearch()
- * .query(bob.termQuery('user', 'kimchy'))
- * .sort(bob.sort('post_date', 'asc'))
- * .sort(bob.sort('user'))
+ * const reqBody = esb.requestBodySearch()
+ * .query(esb.termQuery('user', 'kimchy'))
+ * .sort(esb.sort('post_date', 'asc'))
+ * .sort(esb.sort('user'))
* .sorts([
- * bob.sort('name', 'desc'),
- * bob.sort('age', 'desc'),
- * bob.sort('_score')
+ * esb.sort('name', 'desc'),
+ * esb.sort('age', 'desc'),
+ * esb.sort('_score')
* ]);
*
* @param {Array} sorts Arry of sort
@@ -297,14 +297,14 @@ class RequestBodySearch {
* scores will still be computed and tracked.
*
* @example
- * const reqBody = bob.requestBodySearch()
+ * const reqBody = esb.requestBodySearch()
* .trackScores(true)
* .sorts([
- * bob.sort('post_date', 'desc'),
- * bob.sort('name', 'desc'),
- * bob.sort('age', 'desc')
+ * esb.sort('post_date', 'desc'),
+ * esb.sort('name', 'desc'),
+ * esb.sort('age', 'desc')
* ])
- * .query(bob.termQuery('user', 'kimchy'));
+ * .query(esb.termQuery('user', 'kimchy'));
*
* @param {boolean} enable
@@ -324,26 +324,26 @@ class RequestBodySearch {
*
* @example
* // To disable `_source` retrieval set to `false`:
- * const reqBody = bob.requestBodySearch()
- * .query(bob.termQuery('user', 'kimchy'))
+ * const reqBody = esb.requestBodySearch()
+ * .query(esb.termQuery('user', 'kimchy'))
* .source(false);
*
* @example
* // The `_source` also accepts one or more wildcard patterns to control what
* // parts of the `_source` should be returned:
- * const reqBody = bob.requestBodySearch()
- * .query(bob.termQuery('user', 'kimchy'))
+ * const reqBody = esb.requestBodySearch()
+ * .query(esb.termQuery('user', 'kimchy'))
* .source('obj.*');
*
* // OR
- * const reqBody = bob.requestBodySearch()
- * .query(bob.termQuery('user', 'kimchy'))
+ * const reqBody = esb.requestBodySearch()
+ * .query(esb.termQuery('user', 'kimchy'))
* .source([ 'obj1.*', 'obj2.*' ]);
*
* @example
* // For complete control, you can specify both `includes` and `excludes` patterns:
- * const reqBody = bob.requestBodySearch()
- * .query(bob.termQuery('user', 'kimchy'))
+ * const reqBody = esb.requestBodySearch()
+ * .query(esb.termQuery('user', 'kimchy'))
* .source({
* 'includes': [ 'obj1.*', 'obj2.*' ],
* 'excludes': [ '*.description' ]
@@ -367,20 +367,20 @@ class RequestBodySearch {
* @example
* // Selectively load specific stored fields for each document
* // represented by a search hit
- * const reqBody = bob.requestBodySearch()
- * .query(bob.termQuery('user', 'kimchy'))
+ * const reqBody = esb.requestBodySearch()
+ * .query(esb.termQuery('user', 'kimchy'))
* .storedFields(['user', 'postDate']);
*
* @example
* // Return only the `_id` and `_type` to be returned:
- * const reqBody = bob.requestBodySearch()
- * .query(bob.termQuery('user', 'kimchy'))
+ * const reqBody = esb.requestBodySearch()
+ * .query(esb.termQuery('user', 'kimchy'))
* .storedFields([]);
*
* @example
* // Disable the stored fields (and metadata fields) entirely
- * const reqBody = bob.requestBodySearch()
- * .query(bob.termQuery('user', 'kimchy'))
+ * const reqBody = esb.requestBodySearch()
+ * .query(esb.termQuery('user', 'kimchy'))
* .storedFields('_none_');
*
* @param {Array|string} fields
@@ -395,15 +395,15 @@ class RequestBodySearch {
* Computes a document property dynamically based on the supplied `Script`.
*
* @example
- * const reqBody = bob.requestBodySearch()
- * .query(bob.matchAllQuery())
+ * const reqBody = esb.requestBodySearch()
+ * .query(esb.matchAllQuery())
* .scriptField(
* 'test1',
- * bob.script('inline', "doc['my_field_name'].value * 2").lang('painless')
+ * esb.script('inline', "doc['my_field_name'].value * 2").lang('painless')
* )
* .scriptField(
* 'test2',
- * bob.script('inline', "doc['my_field_name'].value * factor")
+ * esb.script('inline', "doc['my_field_name'].value * factor")
* .lang('painless')
* .params({ factor: 2.0 })
* );
@@ -411,8 +411,8 @@ class RequestBodySearch {
* @example
* // Script fields can also access the actual `_source` document and extract
* // specific elements to be returned from it by using `params['_source']`.
- * const reqBody = bob.requestBodySearch()
- * .query(bob.matchAllQuery())
+ * const reqBody = esb.requestBodySearch()
+ * .query(esb.matchAllQuery())
* .scriptField('test1', "params['_source']['message']");
*
* @param {string} scriptFieldName
@@ -432,13 +432,13 @@ class RequestBodySearch {
* Object should have `scriptFieldName` as key and `script` as the value.
*
* @example
- * const reqBody = bob.requestBodySearch()
- * .query(bob.matchAllQuery())
+ * const reqBody = esb.requestBodySearch()
+ * .query(esb.matchAllQuery())
* .scriptFields({
- * test1: bob
+ * test1: esb
* .script('inline', "doc['my_field_name'].value * 2")
* .lang('painless'),
- * test2: bob
+ * test2: esb
* .script('inline', "doc['my_field_name'].value * factor")
* .lang('painless')
* .params({ factor: 2.0 })
@@ -447,8 +447,8 @@ class RequestBodySearch {
* @example
* // Script fields can also access the actual `_source` document and extract
* // specific elements to be returned from it by using `params['_source']`.
- * const reqBody = bob.requestBodySearch()
- * .query(bob.matchAllQuery())
+ * const reqBody = esb.requestBodySearch()
+ * .query(esb.matchAllQuery())
* .scriptFields({ test1: "params['_source']['message']" });
* @param {Object} scriptFields Object with `scriptFieldName` as key and `script` as the value.
* @returns {TopHitsAggregation} returns `this` so that calls can be chained
@@ -468,8 +468,8 @@ class RequestBodySearch {
* Doc value fields can work on fields that are not stored.
*
* @example
- * const reqBody = bob.requestBodySearch()
- * .query(bob.matchAllQuery())
+ * const reqBody = esb.requestBodySearch()
+ * .query(esb.matchAllQuery())
* .docvalueFields(['test1', 'test2']);
*
* @param {Array} fields
@@ -485,16 +485,16 @@ class RequestBodySearch {
* after aggregations have already been calculated.
*
* @example
- * const reqBody = bob.requestBodySearch()
- * .query(bob.boolQuery().filter(bob.termQuery('brand', 'gucci')))
- * .agg(bob.termsAggregation('colors', 'color'))
+ * const reqBody = esb.requestBodySearch()
+ * .query(esb.boolQuery().filter(esb.termQuery('brand', 'gucci')))
+ * .agg(esb.termsAggregation('colors', 'color'))
* .agg(
- * bob.filterAggregation(
+ * esb.filterAggregation(
* 'color_red',
- * bob.termQuery('color', 'red')
- * ).agg(bob.termsAggregation('models', 'model'))
+ * esb.termQuery('color', 'red')
+ * ).agg(esb.termsAggregation('models', 'model'))
* )
- * .postFilter(bob.termQuery('color', 'red'));
+ * .postFilter(esb.termQuery('color', 'red'));
*
* @param {Query} filterQuery The filter to be applied after aggregation.
* @returns {RequestBodySearch} returns `this` so that calls can be chained
@@ -516,18 +516,18 @@ class RequestBodySearch {
* `index_options` is set to `offsets`.
*
* @example
- * const reqBody = bob.requestBodySearch()
- * .query(bob.matchAllQuery())
- * .highlight(bob.highlight('content'));
+ * const reqBody = esb.requestBodySearch()
+ * .query(esb.matchAllQuery())
+ * .highlight(esb.highlight('content'));
*
* @example
- * const reqBody = bob.requestBodySearch()
+ * const reqBody = esb.requestBodySearch()
* .query(
- * bob.percolateQuery('query', 'doctype').document({
+ * esb.percolateQuery('query', 'doctype').document({
* message: 'The quick brown fox jumps over the lazy dog'
* })
* )
- * .highlight(bob.highlight('message'));
+ * .highlight(esb.highlight('message'));
*
* @param {Highlight} highlight
* @returns {RequestBodySearch} returns `this` so that calls can be chained
@@ -546,34 +546,34 @@ class RequestBodySearch {
* all documents in the index.
*
* @example
- * const reqBody = bob.requestBodySearch()
- * .query(bob.matchQuery('message', 'the quick brown').operator('or'))
+ * const reqBody = esb.requestBodySearch()
+ * .query(esb.matchQuery('message', 'the quick brown').operator('or'))
* .rescore(
- * bob.rescore(
+ * esb.rescore(
* 50,
- * bob.matchPhraseQuery('message', 'the quick brown').slop(2)
+ * esb.matchPhraseQuery('message', 'the quick brown').slop(2)
* )
* .queryWeight(0.7)
* .rescoreQueryWeight(1.2)
* );
*
* @example
- * const reqBody = bob.requestBodySearch()
- * .query(bob.matchQuery('message', 'the quick brown').operator('or'))
+ * const reqBody = esb.requestBodySearch()
+ * .query(esb.matchQuery('message', 'the quick brown').operator('or'))
* .rescore(
- * bob.rescore(
+ * esb.rescore(
* 100,
- * bob.matchPhraseQuery('message', 'the quick brown').slop(2)
+ * esb.matchPhraseQuery('message', 'the quick brown').slop(2)
* )
* .queryWeight(0.7)
* .rescoreQueryWeight(1.2)
* )
* .rescore(
- * bob.rescore(
+ * esb.rescore(
* 10,
- * bob.functionScoreQuery().function(
- * bob.scriptScoreFunction(
- * bob.script('inline', 'Math.log10(doc.likes.value + 2)')
+ * esb.functionScoreQuery().function(
+ * esb.scriptScoreFunction(
+ * esb.script('inline', 'Math.log10(doc.likes.value + 2)')
* )
* )
* ).scoreMode('multiply')
@@ -604,8 +604,8 @@ class RequestBodySearch {
* Enables explanation for each hit on how its score was computed.
*
* @example
- * const reqBody = bob.requestBodySearch()
- * .query(bob.termQuery('user', 'kimchy'))
+ * const reqBody = esb.requestBodySearch()
+ * .query(esb.termQuery('user', 'kimchy'))
* .explain(true);
*
* @param {boolean} enable
@@ -620,8 +620,8 @@ class RequestBodySearch {
* Returns a version for each search hit.
*
* @example
- * const reqBody = bob.requestBodySearch()
- * .query(bob.termQuery('user', 'kimchy'))
+ * const reqBody = esb.requestBodySearch()
+ * .query(esb.termQuery('user', 'kimchy'))
* .version(true);
*
* @param {boolean} enable
@@ -640,7 +640,7 @@ class RequestBodySearch {
* Alias for method `indicesBoost`.
*
* @example
- * const reqBody = bob.requestBodySearch()
+ * const reqBody = esb.requestBodySearch()
* .indexBoost('alias1', 1.4)
* .indexBoost('index*', 1.3);
*
@@ -658,7 +658,7 @@ class RequestBodySearch {
* matter more than hits coming from another index.
*
* @example
- * const reqBody = bob.requestBodySearch()
+ * const reqBody = esb.requestBodySearch()
* .indicesBoost('alias1', 1.4)
* .indicesBoost('index*', 1.3);
*
@@ -679,8 +679,8 @@ class RequestBodySearch {
* Exclude documents which have a `_score` less than the minimum specified in `min_score`.
*
* @example
- * const reqBody = bob.requestBodySearch()
- * .query(bob.termQuery('user', 'kimchy'))
+ * const reqBody = esb.requestBodySearch()
+ * .query(esb.termQuery('user', 'kimchy'))
* .minScore(0.5);
*
* @param {number} score
@@ -699,24 +699,24 @@ class RequestBodySearch {
* field with `doc_values` activated
*
* @example
- * const reqBody = bob.requestBodySearch()
- * .query(bob.matchQuery('message', 'elasticsearch'))
+ * const reqBody = esb.requestBodySearch()
+ * .query(esb.matchQuery('message', 'elasticsearch'))
* .collapse('user')
- * .sort(bob.sort('likes'))
+ * .sort(esb.sort('likes'))
* .from(10);
*
* @example
* // Expand each collapsed top hits with the `inner_hits` option:
- * const reqBody = bob.requestBodySearch()
- * .query(bob.matchQuery('message', 'elasticsearch'))
+ * const reqBody = esb.requestBodySearch()
+ * .query(esb.matchQuery('message', 'elasticsearch'))
* .collapse(
* 'user',
- * bob.innerHits('last_tweets')
+ * esb.innerHits('last_tweets')
* .size(5)
- * .sort(bob.sort('date', 'asc')),
+ * .sort(esb.sort('date', 'asc')),
* 4
* )
- * .sort(bob.sort('likes'))
+ * .sort(esb.sort('likes'))
* .from(10);
*
* @param {string} field
@@ -746,11 +746,11 @@ class RequestBodySearch {
* The parameter `from` must be set to `0` (or `-1`) when `search_after` is used.
*
* @example
- * const reqBody = bob.requestBodySearch()
+ * const reqBody = esb.requestBodySearch()
* .size(10)
- * .query(bob.matchQuery('message', 'elasticsearch'))
+ * .query(esb.matchQuery('message', 'elasticsearch'))
* .searchAfter(1463538857, 'tweet#654323')
- * .sorts([bob.sort('date', 'asc'), bob.sort('_uid', 'desc')]);
+ * .sorts([esb.sort('date', 'asc'), esb.sort('_uid', 'desc')]);
*
* @param {Array} values The `sort values` of the last document to retrieve
* the next page of results
diff --git a/src/core/rescore.js b/src/core/rescore.js
index 13178440..1f6696aa 100644
--- a/src/core/rescore.js
+++ b/src/core/rescore.js
@@ -26,23 +26,23 @@ const invalidScoreModeParam = invalidParam(
* [Elasticsearch reference](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-rescore.html)
*
* @example
- * const reqBody = bob.requestBodySearch()
- * .query(bob.matchQuery('message', 'the quick brown').operator('or'))
+ * const reqBody = esb.requestBodySearch()
+ * .query(esb.matchQuery('message', 'the quick brown').operator('or'))
* .rescore(
- * bob.rescore(
+ * esb.rescore(
* 50,
- * bob.matchPhraseQuery('message', 'the quick brown').slop(2)
+ * esb.matchPhraseQuery('message', 'the quick brown').slop(2)
* )
* .queryWeight(0.7)
* .rescoreQueryWeight(1.2)
* );
*
* @example
- * const rescore = bob.rescore(
+ * const rescore = esb.rescore(
* 10,
- * bob.functionScoreQuery().function(
- * bob.scriptScoreFunction(
- * bob.script('inline', 'Math.log10(doc.likes.value + 2)')
+ * esb.functionScoreQuery().function(
+ * esb.scriptScoreFunction(
+ * esb.script('inline', 'Math.log10(doc.likes.value + 2)')
* )
* )
* ).scoreMode('multiply');
diff --git a/src/core/script.js b/src/core/script.js
index 71e9bb4f..6607ff12 100644
--- a/src/core/script.js
+++ b/src/core/script.js
@@ -12,12 +12,12 @@ const isNil = require('lodash.isnil');
* This needs to be specified if optional argument `type` is passed.
*
* @example
- * const script = bob.script('inline', "doc['my_field'] * multiplier")
+ * const script = esb.script('inline', "doc['my_field'] * multiplier")
* .lang('expression')
* .params({ multiplier: 2 });
*
* // cat "log(_score * 2) + my_modifier" > config/scripts/calculate-score.groovy
- * const script = bob.script()
+ * const script = esb.script()
* .lang('groovy')
* .file('calculate-score')
* .params({ my_modifier: 2 });
diff --git a/src/core/search-template.js b/src/core/search-template.js
index bd4b33c6..14560bac 100644
--- a/src/core/search-template.js
+++ b/src/core/search-template.js
@@ -19,8 +19,8 @@ const { recursiveToJSON } = require('./util');
* This needs to be specified if optional argument `type` is passed.
*
* @example
- * const templ = bob.searchTemplate('inline', {
- * query: bob.matchQuery('{{my_field}}', '{{my_value}}'),
+ * const templ = esb.searchTemplate('inline', {
+ * query: esb.matchQuery('{{my_field}}', '{{my_value}}'),
* size: '{{my_size}}'
* }).params({
* my_field: 'message',
@@ -29,7 +29,7 @@ const { recursiveToJSON } = require('./util');
* });
*
* @example
- * const templ = new bob.SearchTemplate(
+ * const templ = new esb.SearchTemplate(
* 'inline',
* '{ "query": { "terms": {{#toJson}}statuses{{/toJson}} }}'
* ).params({
@@ -39,14 +39,14 @@ const { recursiveToJSON } = require('./util');
* });
*
* @example
- * const templ = new bob.SearchTemplate(
+ * const templ = new esb.SearchTemplate(
* 'inline',
* '{ "query": { "bool": { "must": {{#toJson}}clauses{{/toJson}} } } }'
* ).params({
* clauses: [
- * bob.termQuery('user', 'boo'),
- * bob.termQuery('user', 'bar'),
- * bob.termQuery('user', 'baz')
+ * esb.termQuery('user', 'boo'),
+ * esb.termQuery('user', 'bar'),
+ * esb.termQuery('user', 'baz')
* ]
* });
*/
@@ -160,7 +160,7 @@ class SearchTemplate {
* @example
* // `templId` - Name of the query template in config/scripts/, i.e.,
* // storedTemplate.mustache.
- * const templ = new bob.SearchTemplate('file', 'storedTemplate').params({
+ * const templ = new esb.SearchTemplate('file', 'storedTemplate').params({
* query_string: 'search for these words'
* });
*
diff --git a/src/core/sort.js b/src/core/sort.js
index d585893f..dd4e9f6c 100644
--- a/src/core/sort.js
+++ b/src/core/sort.js
@@ -27,9 +27,9 @@ const invalidUnitParam = invalidParam(ES_REF_URL, 'unit', UNIT_SET);
* [Elasticsearch reference](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-sort.html)
*
* @example
- * const reqBody = bob.requestBodySearch()
- * .query(bob.termQuery('user', 'kimchy'))
- * .sort(bob.sort('post_date', 'asc'))
+ * const reqBody = esb.requestBodySearch()
+ * .query(esb.termQuery('user', 'kimchy'))
+ * .sort(esb.sort('post_date', 'asc'))
*
* @param {string} field The field to sort on
* @param {string=} order The `order` option can have the following values.
@@ -84,7 +84,7 @@ class Sort {
* Only applicable for number based array fields.
*
* @example
- * const sort = bob.sort('price', 'asc').mode('avg');
+ * const sort = esb.sort('price', 'asc').mode('avg');
*
* @param {string} mode One of `avg`, `min`, `max`, `sum` and `median`.
* @returns {Sort} returns `this` so that calls can be chained.
@@ -107,9 +107,9 @@ class Sort {
* is mandatory.
*
* @example
- * const sort = bob.sort('offer.price', 'asc')
+ * const sort = esb.sort('offer.price', 'asc')
* .nestedPath('offer')
- * .nestedFilter(bob.termQuery('offer.color', 'blue'));
+ * .nestedFilter(esb.termQuery('offer.color', 'blue'));
*
* @param {string} path Nested object to sort on
* @returns {Sort} returns `this` so that calls can be chained.
@@ -125,9 +125,9 @@ class Sort {
* `nested_filter` is active.
*
* @example
- * const sort = bob.sort('offer.price', 'asc')
+ * const sort = esb.sort('offer.price', 'asc')
* .nestedPath('offer')
- * .nestedFilter(bob.termQuery('offer.color', 'blue'));
+ * .nestedFilter(esb.termQuery('offer.color', 'blue'));
*
* @param {Query} filterQuery
* @returns {Sort} returns `this` so that calls can be chained.
@@ -146,7 +146,7 @@ class Sort {
* (that will be used for missing docs as the sort value). The default is `_last`.
*
* @example
- * const sort = bob.sort('price').missing('_last');
+ * const sort = esb.sort('price').missing('_last');
*
* @param {string|number} value
* @returns {Sort} returns `this` so that calls can be chained.
@@ -163,7 +163,7 @@ class Sort {
* values to emit.
*
* @example
- * const sort = bob.sort('price').unmappedType('long');
+ * const sort = esb.sort('price').unmappedType('long');
*
* @param {string} type
* @returns {Sort} returns `this` so that calls can be chained.
@@ -180,7 +180,7 @@ class Sort {
* points contained in the document to all points given in the sort request.
*
* @example
- * const sort = bob.sort('pin.location', 'asc')
+ * const sort = esb.sort('pin.location', 'asc')
* .geoDistance([-70, 40])
* .unit('km')
* .mode('min')
@@ -241,10 +241,10 @@ class Sort {
* Sorts based on custom script. When sorting on a field, scores are not computed.
*
* @example
- * const sort = bob.sort()
+ * const sort = esb.sort()
* .type('number')
* .script(
- * bob.script('inline', "doc['field_name'].value * params.factor")
+ * esb.script('inline', "doc['field_name'].value * params.factor")
* .lang('painless')
* .params({ factor: 1.1 })
* )
diff --git a/src/index.d.ts b/src/index.d.ts
index cf9c9446..4b7a2fbe 100644
--- a/src/index.d.ts
+++ b/src/index.d.ts
@@ -2,9 +2,9 @@
// Project: https://elastic-builder.js.org
// Definitions by: Suhas Karanth
-export = bob;
+export = esb;
-declare namespace bob {
+declare namespace esb {
/**
* The `RequestBodySearch` object provides methods generating an elasticsearch
* search request body. The search request can be executed with a search DSL,
@@ -8207,7 +8207,7 @@ declare namespace bob {
export namespace recipes {
/**
* Recipe for the now removed `missing` query.
- * Can be accessed using `bob.recipes.missingQuery` OR `bob.cookMissingQuery`.
+ * Can be accessed using `esb.recipes.missingQuery` OR `esb.cookMissingQuery`.
*
* @param {string} field The field which should be missing the value.
*/
@@ -8216,7 +8216,7 @@ declare namespace bob {
/**
* Recipe for random sort query. Takes a query and returns the same
* wrapped in a random scoring query.
- * Can be accessed using `bob.recipes.randomSortQuery` OR `bob.cookRandomSortQuery`.
+ * Can be accessed using `esb.recipes.randomSortQuery` OR `esb.cookRandomSortQuery`.
*
* @param {Query=} query The query to fetch documents for. Defaults to `match_all` query.
* @param {number=} seed A seed value for the random score function.
@@ -8230,7 +8230,7 @@ declare namespace bob {
/**
* Recipe for constructing a filter query using `bool` query.
* Optionally, scoring can be enabled.
- * Can be accessed using `bob.recipes.filterQuery` OR `bob.cookFilterQuery`.
+ * Can be accessed using `esb.recipes.filterQuery` OR `esb.cookFilterQuery`.
*
* @param {Query} query The query to fetch documents for.
* @param {boolean=} scoring Optional flag for enabling/disabling scoring. Disabled by default.
@@ -8244,7 +8244,7 @@ declare namespace bob {
/**
* Recipe for the now removed `missing` query.
- * Can be accessed using `bob.recipes.missingQuery` OR `bob.cookMissingQuery`.
+ * Can be accessed using `esb.recipes.missingQuery` OR `esb.cookMissingQuery`.
*
* @param {string} field The field which should be missing the value.
*/
@@ -8253,7 +8253,7 @@ declare namespace bob {
/**
* Recipe for random sort query. Takes a query and returns the same
* wrapped in a random scoring query.
- * Can be accessed using `bob.recipes.randomSortQuery` OR `bob.cookRandomSortQuery`.
+ * Can be accessed using `esb.recipes.randomSortQuery` OR `esb.cookRandomSortQuery`.
*
* @param {Query=} query The query to fetch documents for. Defaults to `match_all` query.
* @param {number=} seed A seed value for the random score function.
@@ -8267,7 +8267,7 @@ declare namespace bob {
/**
* Recipe for constructing a filter query using `bool` query.
* Optionally, scoring can be enabled.
- * Can be accessed using `bob.recipes.filterQuery` OR `bob.cookFilterQuery`.
+ * Can be accessed using `esb.recipes.filterQuery` OR `esb.cookFilterQuery`.
*
* @param {Query} query The query to fetch documents for.
* @param {boolean=} scoring Optional flag for enabling/disabling scoring. Disabled by default.
diff --git a/src/index.js b/src/index.js
index 0e340313..ed2db40c 100644
--- a/src/index.js
+++ b/src/index.js
@@ -527,11 +527,11 @@ exports.completionSuggester = constructorWrapper(CompletionSuggester);
*
* @example
* // `recipes` namespace
- * const qry = bob.recipes.missingQuery('user');
+ * const qry = esb.recipes.missingQuery('user');
*
* @example
* // `cookMissingQuery` alias
- * const qry = bob.cookMissingQuery('user');
+ * const qry = esb.cookMissingQuery('user');
*/
exports.recipes = recipes;
exports.cookMissingQuery = recipes.missingQuery;
diff --git a/src/queries/compound-queries/bool-query.js b/src/queries/compound-queries/bool-query.js
index 65b8056f..5ee45007 100644
--- a/src/queries/compound-queries/bool-query.js
+++ b/src/queries/compound-queries/bool-query.js
@@ -17,13 +17,13 @@ const {
* [Elasticsearch reference](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-bool-query.html)
*
* @example
- * const qry = bob.boolQuery()
- * .must(bob.termQuery('user', 'kimchy'))
- * .filter(bob.termQuery('tag', 'tech'))
- * .mustNot(bob.rangeQuery('age').gte(10).lte(20))
+ * const qry = esb.boolQuery()
+ * .must(esb.termQuery('user', 'kimchy'))
+ * .filter(esb.termQuery('tag', 'tech'))
+ * .mustNot(esb.rangeQuery('age').gte(10).lte(20))
* .should([
- * bob.termQuery('tag', 'wow'),
- * bob.termQuery('tag', 'elasticsearch')
+ * esb.termQuery('tag', 'wow'),
+ * esb.termQuery('tag', 'elasticsearch')
* ])
* .minimumShouldMatch(1)
* .boost(1.0);
@@ -87,12 +87,12 @@ class BoolQuery extends Query {
*
* @example
* // Assign score of `0` to all documents
- * const qry = bob.boolQuery().filter(bob.termQuery('status', 'active'));
+ * const qry = esb.boolQuery().filter(esb.termQuery('status', 'active'));
*
* // Assign a score of `1.0` to all documents
- * const qry = bob.boolQuery()
- * .must(bob.matchAllQuery())
- * .filter(bob.termQuery('status', 'active'));
+ * const qry = esb.boolQuery()
+ * .must(esb.matchAllQuery())
+ * .filter(esb.termQuery('status', 'active'));
*
* @param {Array|Query} queries List of valid `Query` objects or a `Query` object
* @returns {BoolQuery} returns `this` so that calls can be chained.
diff --git a/src/queries/compound-queries/boosting-query.js b/src/queries/compound-queries/boosting-query.js
index 407f1073..88d60476 100644
--- a/src/queries/compound-queries/boosting-query.js
+++ b/src/queries/compound-queries/boosting-query.js
@@ -13,9 +13,9 @@ const { Query, util: { checkType } } = require('../../core');
* [Elasticsearch reference](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-boosting-query.html)
*
* @example
- * const qry = bob.boostingQuery(
- * bob.termQuery('field1', 'value1'), // positiveQry
- * bob.termQuery('field2', 'value2'), // negativeQry
+ * const qry = esb.boostingQuery(
+ * esb.termQuery('field1', 'value1'), // positiveQry
+ * esb.termQuery('field2', 'value2'), // negativeQry
* 0.2 // negativeBoost
* );
*
diff --git a/src/queries/compound-queries/constant-score-query.js b/src/queries/compound-queries/constant-score-query.js
index f0bfee45..a538bdc0 100644
--- a/src/queries/compound-queries/constant-score-query.js
+++ b/src/queries/compound-queries/constant-score-query.js
@@ -15,7 +15,7 @@ const { Query, util: { checkType } } = require('../../core');
* [Elasticsearch reference](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-constant-score-query.html)
*
* @example
- * const qry = bob.constantScoreQuery(bob.termQuery('user', 'kimchy')).boost(1.2);
+ * const qry = esb.constantScoreQuery(esb.termQuery('user', 'kimchy')).boost(1.2);
*
* @param {Query=} filterQuery Query to filter on.
*
diff --git a/src/queries/compound-queries/dis-max-query.js b/src/queries/compound-queries/dis-max-query.js
index 6272e7d9..890d619d 100644
--- a/src/queries/compound-queries/dis-max-query.js
+++ b/src/queries/compound-queries/dis-max-query.js
@@ -11,16 +11,16 @@ const { Query, util: { checkType, setDefault } } = require('../../core');
* [Elasticsearch reference](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-dis-max-query.html)
*
* @example
- * const qry = bob.disMaxQuery()
- * .queries([bob.termQuery('age', 34), bob.termQuery('age', 35)])
+ * const qry = esb.disMaxQuery()
+ * .queries([esb.termQuery('age', 34), esb.termQuery('age', 35)])
* .tieBreaker(0.7)
* .boost(1.2);
*
* @example
- * const qry = bob.disMaxQuery()
+ * const qry = esb.disMaxQuery()
* .queries([
- * bob.matchQuery('subject', 'brown fox'),
- * bob.matchQuery('message', 'brown fox')
+ * esb.matchQuery('subject', 'brown fox'),
+ * esb.matchQuery('message', 'brown fox')
* ])
* .tieBreaker(0.3);
*
diff --git a/src/queries/compound-queries/function-score-query.js b/src/queries/compound-queries/function-score-query.js
index de7f7c2e..e4f8b193 100644
--- a/src/queries/compound-queries/function-score-query.js
+++ b/src/queries/compound-queries/function-score-query.js
@@ -37,22 +37,22 @@ const invalidBoostModeParam = invalidParam(
*
* @example
* // `function_score` with only one function
- * const qry = bob.functionScoreQuery()
- * .query(bob.matchAllQuery())
- * .function(bob.randomScoreFunction())
+ * const qry = esb.functionScoreQuery()
+ * .query(esb.matchAllQuery())
+ * .function(esb.randomScoreFunction())
* .boostMode('multiply')
* .boost('5');
*
* @example
* // Several functions combined
- * const qry = bob.functionScoreQuery()
- * .query(bob.matchAllQuery())
+ * const qry = esb.functionScoreQuery()
+ * .query(esb.matchAllQuery())
* .functions([
- * bob.randomScoreFunction()
- * .filter(bob.matchQuery('test', 'bar'))
+ * esb.randomScoreFunction()
+ * .filter(esb.matchQuery('test', 'bar'))
* .weight(23),
- * bob.weightScoreFunction()
- * .filter(bob.matchQuery('test', 'cat'))
+ * esb.weightScoreFunction()
+ * .filter(esb.matchQuery('test', 'cat'))
* .weight(42)
* ])
* .maxBoost(42)
@@ -63,14 +63,14 @@ const invalidBoostModeParam = invalidParam(
*
* @example
* // Combine decay functions
- * const qry = bob.functionScoreQuery()
+ * const qry = esb.functionScoreQuery()
* .functions([
- * bob.decayScoreFunction('gauss', 'price').origin('0').scale('20'),
- * bob.decayScoreFunction('gauss', 'location')
+ * esb.decayScoreFunction('gauss', 'price').origin('0').scale('20'),
+ * esb.decayScoreFunction('gauss', 'location')
* .origin('11, 12')
* .scale('2km')
* ])
- * .query(bob.matchQuery('properties', 'balcony'))
+ * .query(esb.matchQuery('properties', 'balcony'))
* .scoreMode('multiply');
*
* @extends Query
diff --git a/src/queries/compound-queries/score-functions/decay-score-function.js b/src/queries/compound-queries/score-functions/decay-score-function.js
index dac6c34b..053af4c0 100644
--- a/src/queries/compound-queries/score-functions/decay-score-function.js
+++ b/src/queries/compound-queries/score-functions/decay-score-function.js
@@ -29,7 +29,7 @@ const invalidModeParam = invalidParam(
*
* @example
* // Defaults to decay function `gauss`
- * const decayFunc = bob.decayScoreFunction()
+ * const decayFunc = esb.decayScoreFunction()
* .field('location') // field is a geo_point
* .origin('11, 12') // geo format
* .scale('2km')
@@ -37,7 +37,7 @@ const invalidModeParam = invalidParam(
* .decay(0.33);
*
* @example
- * const decayFunc = bob.decayScoreFunction('gauss', 'date')
+ * const decayFunc = esb.decayScoreFunction('gauss', 'date')
* .origin('2013-09-17')
* .scale('10d')
* .offset('5d')
diff --git a/src/queries/compound-queries/score-functions/field-value-factor-function.js b/src/queries/compound-queries/score-functions/field-value-factor-function.js
index ed65fbba..de581a64 100644
--- a/src/queries/compound-queries/score-functions/field-value-factor-function.js
+++ b/src/queries/compound-queries/score-functions/field-value-factor-function.js
@@ -28,7 +28,7 @@ const invaliModifierdParam = invalidParam(
*
* @example
* // Scoring formula - sqrt(1.2 * doc['popularity'].value)
- * const scoreFunc = bob.fieldValueFactorFunction('popularity')
+ * const scoreFunc = esb.fieldValueFactorFunction('popularity')
* .factor(1.2)
* .modifier('sqrt')
* .missing(1);
diff --git a/src/queries/compound-queries/score-functions/random-score-function.js b/src/queries/compound-queries/score-functions/random-score-function.js
index f3c300d3..29c2d924 100644
--- a/src/queries/compound-queries/score-functions/random-score-function.js
+++ b/src/queries/compound-queries/score-functions/random-score-function.js
@@ -9,7 +9,7 @@ const ScoreFunction = require('./score-function');
* [Elasticsearch reference](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-function-score-query.html#function-random)
*
* @example
- * const scoreFunc = bob.randomScoreFunction().seed(299792458);
+ * const scoreFunc = esb.randomScoreFunction().seed(299792458);
*
* @extends ScoreFunction
*/
diff --git a/src/queries/compound-queries/score-functions/script-score-function.js b/src/queries/compound-queries/score-functions/script-score-function.js
index ff4e446d..5414a808 100644
--- a/src/queries/compound-queries/score-functions/script-score-function.js
+++ b/src/queries/compound-queries/score-functions/script-score-function.js
@@ -12,15 +12,15 @@ const ScoreFunction = require('./score-function');
* [Elasticsearch reference](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-function-score-query.html#function-script-score)
*
* @example
- * const scoreFunc = bob.scriptScoreFunction(
- * bob.script('inline', "_score * doc['my_numeric_field'].value")
+ * const scoreFunc = esb.scriptScoreFunction(
+ * esb.script('inline', "_score * doc['my_numeric_field'].value")
* .lang('painless')
* );
*
* @example
* // Script with parameters
- * const scoreFunc = bob.scriptScoreFunction(
- * bob.script(
+ * const scoreFunc = esb.scriptScoreFunction(
+ * esb.script(
* 'inline',
* "_score * doc['my_numeric_field'].value / Math.pow(params.param1, params.param2)"
* )
diff --git a/src/queries/compound-queries/score-functions/weight-score-function.js b/src/queries/compound-queries/score-functions/weight-score-function.js
index 1b39015f..c9149118 100644
--- a/src/queries/compound-queries/score-functions/weight-score-function.js
+++ b/src/queries/compound-queries/score-functions/weight-score-function.js
@@ -15,7 +15,7 @@ const { util: { recursiveToJSON } } = require('../../../core');
* [Elasticsearch reference](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-function-score-query.html#function-weight)
*
* @example
- * const scoreFunc = bob.weightScoreFunction(42);
+ * const scoreFunc = esb.weightScoreFunction(42);
*
* @param {number=} weight The weight of this score function.
* @extends ScoreFunction
diff --git a/src/queries/full-text-queries/common-terms-query.js b/src/queries/full-text-queries/common-terms-query.js
index 1f71d5ab..da013ec6 100644
--- a/src/queries/full-text-queries/common-terms-query.js
+++ b/src/queries/full-text-queries/common-terms-query.js
@@ -29,7 +29,7 @@ const invalidHighFreqOpParam = invalidParam(
* [Elasticsearch reference](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-common-terms-query.html)
*
* @example
- * const qry = bob.commonTermsQuery('body','this is bonsai cool')
+ * const qry = esb.commonTermsQuery('body','this is bonsai cool')
* .cutoffFrequency(0.001);
*
* @param {string=} field The document field to query against
@@ -99,7 +99,7 @@ class CommonTermsQuery extends MonoFieldQueryBase {
* can be set to `or` or `and` to control the boolean clauses (defaults to `or`).
*
* @example
- * const qry = bob.commonTermsQuery('body', 'nelly the elephant as a cartoon')
+ * const qry = esb.commonTermsQuery('body', 'nelly the elephant as a cartoon')
* .lowFreqOperator('and')
* .cutoffFrequency(0.001);
*
@@ -144,7 +144,7 @@ class CommonTermsQuery extends MonoFieldQueryBase {
* a percentage (30%) or a combination of both.
*
* @example
- * const qry = bob.commonTermsQuery('body', 'nelly the elephant as a cartoon')
+ * const qry = esb.commonTermsQuery('body', 'nelly the elephant as a cartoon')
* .lowFreq(2)
* .highFreq(3)
* .cutoffFrequency(0.001);
@@ -165,7 +165,7 @@ class CommonTermsQuery extends MonoFieldQueryBase {
* a percentage (30%) or a combination of both.
*
* @example
- * const qry = bob.commonTermsQuery('body', 'nelly the elephant as a cartoon')
+ * const qry = esb.commonTermsQuery('body', 'nelly the elephant as a cartoon')
* .lowFreq(2)
* .highFreq(3)
* .cutoffFrequency(0.001);
diff --git a/src/queries/full-text-queries/full-text-query-base.js b/src/queries/full-text-queries/full-text-query-base.js
index a73af152..46455301 100644
--- a/src/queries/full-text-queries/full-text-query-base.js
+++ b/src/queries/full-text-queries/full-text-query-base.js
@@ -36,11 +36,11 @@ class FullTextQueryBase extends Query {
* Set the analyzer to control which analyzer will perform the analysis process on the text
*
* @example
- * const qry = bob.matchPhraseQuery('message', 'this is a test')
+ * const qry = esb.matchPhraseQuery('message', 'this is a test')
* .analyzer('my_analyzer');
*
* @example
- * const qry = bob.multiMatchQuery(['first', 'last', '*.edge'], 'Jon')
+ * const qry = esb.multiMatchQuery(['first', 'last', '*.edge'], 'Jon')
* .type('cross_fields')
* .analyzer('standard');
*
@@ -60,7 +60,7 @@ class FullTextQueryBase extends Query {
* keys `low_freq` and `high_freq` can be used.
*
* @example
- * const qry = bob.commonTermsQuery('body', 'nelly the elephant as a cartoon')
+ * const qry = esb.commonTermsQuery('body', 'nelly the elephant as a cartoon')
* .minimumShouldMatch(2)
* .cutoffFrequency(0.001);
*
@@ -77,7 +77,7 @@ class FullTextQueryBase extends Query {
* Sets the query string.
*
* @example
- * const qry = bob.queryStringQuery()
+ * const qry = esb.queryStringQuery()
* .query('city.\\*:(this AND that OR thus)')
* .useDisMax(true);
*
diff --git a/src/queries/full-text-queries/match-phrase-prefix-query.js b/src/queries/full-text-queries/match-phrase-prefix-query.js
index 0b808f7c..a47e828f 100644
--- a/src/queries/full-text-queries/match-phrase-prefix-query.js
+++ b/src/queries/full-text-queries/match-phrase-prefix-query.js
@@ -9,7 +9,7 @@ const ES_REF_URL =
* [Elasticsearch reference](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-match-query-phrase-prefix.html)
*
* @example
- * const qry = bob.matchPhrasePrefixQuery('message', 'quick brown f');
+ * const qry = esb.matchPhrasePrefixQuery('message', 'quick brown f');
*
* @param {string=} field The document field to query against
* @param {string=} queryString The query string
@@ -26,7 +26,7 @@ class MatchPhrasePrefixQuery extends MatchPhraseQueryBase {
* Control to how many prefixes the last term will be expanded.
*
* @example
- * const qry = bob.matchPhrasePrefixQuery('message', 'quick brown f')
+ * const qry = esb.matchPhrasePrefixQuery('message', 'quick brown f')
* .maxExpansions(10);
*
* @param {number} limit Defaults to 50.
diff --git a/src/queries/full-text-queries/match-phrase-query.js b/src/queries/full-text-queries/match-phrase-query.js
index 744875ba..148ff1ed 100644
--- a/src/queries/full-text-queries/match-phrase-query.js
+++ b/src/queries/full-text-queries/match-phrase-query.js
@@ -12,7 +12,7 @@ const ES_REF_URL =
* [Elasticsearch reference](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-match-query-phrase.html)
*
* @example
- * const qry = bob.matchPhraseQuery('message', 'to be or not to be');
+ * const qry = esb.matchPhraseQuery('message', 'to be or not to be');
*
* @param {string=} field The document field to query against
* @param {string=} queryString The query string
diff --git a/src/queries/full-text-queries/match-query.js b/src/queries/full-text-queries/match-query.js
index c289fd37..4ab2a410 100644
--- a/src/queries/full-text-queries/match-query.js
+++ b/src/queries/full-text-queries/match-query.js
@@ -29,7 +29,7 @@ const invalidZeroTermsQueryParam = invalidParam(
* @param {string=} queryString The query string
*
* @example
- * const matchQry = bob.matchQuery('message', 'to be or not to be');
+ * const matchQry = esb.matchQuery('message', 'to be or not to be');
*
* @extends MonoFieldQueryBase
*/
@@ -81,7 +81,7 @@ class MatchQuery extends MonoFieldQueryBase {
* the same as another string.
*
* @example
- * const qry = bob.matchQuery('message', 'this is a test').operator('and');
+ * const qry = esb.matchQuery('message', 'this is a test').operator('and');
*
* @param {number|string} factor Can be specified either as a number, or the maximum
* number of edits, or as `AUTO` which generates an edit distance based on the length
@@ -217,7 +217,7 @@ class MatchQuery extends MonoFieldQueryBase {
* which corresponds to a `match_all` query.
*
* @example
- * const qry = bob.matchQuery('message', 'to be or not to be')
+ * const qry = esb.matchQuery('message', 'to be or not to be')
* .operator('and')
* .zeroTermsQuery('all');
*
@@ -243,7 +243,7 @@ class MatchQuery extends MonoFieldQueryBase {
* all of the low frequency terms in the case of an `and` operator match.
*
* @example
- * const qry = bob.matchQuery('message', 'to be or not to be')
+ * const qry = esb.matchQuery('message', 'to be or not to be')
* .cutoffFrequency(0.001);
*
* @param {number} frequency It can either be relative to the total number of documents
diff --git a/src/queries/full-text-queries/multi-match-query.js b/src/queries/full-text-queries/multi-match-query.js
index 30ba7e58..07d2ae41 100644
--- a/src/queries/full-text-queries/multi-match-query.js
+++ b/src/queries/full-text-queries/multi-match-query.js
@@ -34,7 +34,7 @@ const invalidBehaviorParam = invalidParam(
* [Elasticsearch reference](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-multi-match-query.html)
*
* @example
- * const qry = bob.multiMatchQuery(['subject', 'message'], 'this is a test');
+ * const qry = esb.multiMatchQuery(['subject', 'message'], 'this is a test');
*
* @param {Array|string=} fields The fields to be queried
* @param {string=} queryString The query string
@@ -81,11 +81,11 @@ class MultiMatchQuery extends FullTextQueryBase {
*
* @example
* // Boost individual fields with caret `^` notation
- * const qry = bob.multiMatchQuery(['subject^3', 'message'], 'this is a test');
+ * const qry = esb.multiMatchQuery(['subject^3', 'message'], 'this is a test');
*
* @example
* // Specify fields with wildcards
- *const qry = bob.multiMatchQuery(['title', '*_name'], 'Will Smith');
+ *const qry = esb.multiMatchQuery(['title', '*_name'], 'Will Smith');
*
* @param {Array} fields The fields to be queried
* @returns {MultiMatchQuery} returns `this` so that calls can be chained.
@@ -116,27 +116,27 @@ class MultiMatchQuery extends FullTextQueryBase {
*
* @example
* // Find the single best matching field
- * const qry = bob.multiMatchQuery(['subject', 'message'], 'brown fox')
+ * const qry = esb.multiMatchQuery(['subject', 'message'], 'brown fox')
* .type('best_fields')
* .tieBreaker(0.3);
*
* @example
* // Query multiple fields analyzed differently for the same text
- * const qry = bob.multiMatchQuery(
+ * const qry = esb.multiMatchQuery(
* ['title', 'title.original', 'title.shingles'],
* 'quick brown fox'
* ).type('most_fields');
*
* @example
* // Run a `match_phrase_prefix` query on multiple fields
- * const qry = bob.multiMatchQuery(
+ * const qry = esb.multiMatchQuery(
* ['subject', 'message'],
* 'quick brown f'
* ).type('phrase_prefix');
*
* @example
* // All terms must be present in at least one field for document to match
- * const qry = bob.multiMatchQuery(['first_name', 'last_name'], 'Will Smith')
+ * const qry = esb.multiMatchQuery(['first_name', 'last_name'], 'Will Smith')
* .type('cross_fields')
* .operator('and');
*
diff --git a/src/queries/full-text-queries/query-string-query-base.js b/src/queries/full-text-queries/query-string-query-base.js
index fb69e760..2f1ba885 100644
--- a/src/queries/full-text-queries/query-string-query-base.js
+++ b/src/queries/full-text-queries/query-string-query-base.js
@@ -40,12 +40,12 @@ class QueryStringQueryBase extends FullTextQueryBase {
* Example - `"subject^3"`
*
* @example
- * const qry = bob.queryStringQuery('this AND that OR thus')
+ * const qry = esb.queryStringQuery('this AND that OR thus')
* .field('city.*')
* .useDisMax(true);
*
* @example
- * const qry = bob.simpleQueryStringQuery('foo bar -baz').field('content');
+ * const qry = esb.simpleQueryStringQuery('foo bar -baz').field('content');
*
* @param {string} field One of the fields to be queried
* @returns {QueryStringQueryBase} returns `this` so that calls can be chained.
@@ -65,11 +65,11 @@ class QueryStringQueryBase extends FullTextQueryBase {
* Example - `[ "subject^3", "message" ]`
*
* @example
- * const qry = bob.queryStringQuery('this AND that')
+ * const qry = esb.queryStringQuery('this AND that')
* .fields(['content', 'name'])
*
* @example
- * const qry = bob.simpleQueryStringQuery('foo bar baz')
+ * const qry = esb.simpleQueryStringQuery('foo bar baz')
* .fields(['content', 'name.*^5']);
*
* @param {Array} fields The fields to be queried
diff --git a/src/queries/full-text-queries/query-string-query.js b/src/queries/full-text-queries/query-string-query.js
index 94262cd1..3e9cd7c7 100644
--- a/src/queries/full-text-queries/query-string-query.js
+++ b/src/queries/full-text-queries/query-string-query.js
@@ -12,7 +12,7 @@ const ES_REF_URL =
* [Elasticsearch reference](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html)
*
* @example
- * const qry = bob.queryStringQuery('this AND that OR thus')
+ * const qry = esb.queryStringQuery('this AND that OR thus')
* .defaultField('content');
*
* @param {string=} queryString The actual query to be parsed.
@@ -258,7 +258,7 @@ class QueryStringQuery extends QueryStringQueryBase {
* parameter must be used instead.
*
* @example
- * const qry = bob.queryStringQuery('this AND that OR thus')
+ * const qry = esb.queryStringQuery('this AND that OR thus')
* .fields(['content', 'name^5'])
* .useDisMax(true);
*
diff --git a/src/queries/full-text-queries/simple-query-string-query.js b/src/queries/full-text-queries/simple-query-string-query.js
index 8456aa87..5de33196 100644
--- a/src/queries/full-text-queries/simple-query-string-query.js
+++ b/src/queries/full-text-queries/simple-query-string-query.js
@@ -13,7 +13,7 @@ const ES_REF_URL =
* [Elasticsearch reference](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-simple-query-string-query.html)
*
* @example
- * const qry = bob.simpleQueryStringQuery(
+ * const qry = esb.simpleQueryStringQuery(
* '"fried eggs" +(eggplant | potato) -frittata'
* )
* .analyzer('snowball')
@@ -35,7 +35,7 @@ class SimpleQueryStringQuery extends QueryStringQueryBase {
* should be enabled. It is specified as a `|`-delimited string.
*
* @example
- * const qry = bob.simpleQueryStringQuery('foo | bar + baz*')
+ * const qry = esb.simpleQueryStringQuery('foo | bar + baz*')
* .flags('OR|AND|PREFIX');
*
* @param {string} flags `|` delimited string. The available flags are: `ALL`, `NONE`,
diff --git a/src/queries/geo-queries/geo-bounding-box-query.js b/src/queries/geo-queries/geo-bounding-box-query.js
index 12b615f0..e9ac03e8 100644
--- a/src/queries/geo-queries/geo-bounding-box-query.js
+++ b/src/queries/geo-queries/geo-bounding-box-query.js
@@ -22,24 +22,24 @@ const invalidTypeParam = invalidParam(
*
* @example
* // Format of point in Geohash
- * const qry = bob.geoBoundingBoxQuery('pin.location')
- * .topLeft(bob.geoPoint().string('dr5r9ydj2y73'))
- * .bottomRight(bob.geoPoint().string('drj7teegpus6'));
+ * const qry = esb.geoBoundingBoxQuery('pin.location')
+ * .topLeft(esb.geoPoint().string('dr5r9ydj2y73'))
+ * .bottomRight(esb.geoPoint().string('drj7teegpus6'));
*
* @example
* // Format of point with lat lon as properties
- * const qry = bob.geoBoundingBoxQuery()
+ * const qry = esb.geoBoundingBoxQuery()
* .field('pin.location')
- * .topLeft(bob.geoPoint()
+ * .topLeft(esb.geoPoint()
* .lat(40.73)
* .lon(-74.1))
- * .bottomRight(bob.geoPoint()
+ * .bottomRight(esb.geoPoint()
* .lat(40.10)
* .lon(-71.12));
*
* @example
* // Set bounding box values separately
- * const qry = bob.geoBoundingBoxQuery('pin.location')
+ * const qry = esb.geoBoundingBoxQuery('pin.location')
* .top(40.73)
* .left(-74.1)
* .bottom(40.01)
@@ -164,12 +164,12 @@ class GeoBoundingBoxQuery extends GeoQueryBase {
*
* @example
*
- * const geoQry = bob.geoBoundingBoxQuery()
+ * const geoQry = esb.geoBoundingBoxQuery()
* .field('pin.location')
- * .topLeft(bob.geoPoint()
+ * .topLeft(esb.geoPoint()
* .lat(40.73)
* .lon(-74.1))
- * .bottomRight(bob.geoPoint()
+ * .bottomRight(esb.geoPoint()
* .lat(40.10)
* .lon(-71.12))
* .type('indexed');
diff --git a/src/queries/geo-queries/geo-distance-query.js b/src/queries/geo-queries/geo-distance-query.js
index 8c576100..6d085784 100644
--- a/src/queries/geo-queries/geo-distance-query.js
+++ b/src/queries/geo-queries/geo-distance-query.js
@@ -21,13 +21,13 @@ const invalidDistanceTypeParam = invalidParam(
* [Elasticsearch reference](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-geo-distance-query.html)
*
* @example
- * const qry = bob.geoDistanceQuery('pin.location', bob.geoPoint().lat(40).lon(-70))
+ * const qry = esb.geoDistanceQuery('pin.location', esb.geoPoint().lat(40).lon(-70))
* .distance('12km');
*
- * const qry = bob.geoDistanceQuery()
+ * const qry = esb.geoDistanceQuery()
* .field('pin.location')
* .distance('200km')
- * .geoPoint(bob.geoPoint().lat(40).lon(-70));
+ * .geoPoint(esb.geoPoint().lat(40).lon(-70));
*
* @param {string=} field
* @param {GeoPoint=} point Geo point used to measure and filter documents based on distance from it.
diff --git a/src/queries/geo-queries/geo-polygon-query.js b/src/queries/geo-queries/geo-polygon-query.js
index eba4fb68..4ef9f24c 100644
--- a/src/queries/geo-queries/geo-polygon-query.js
+++ b/src/queries/geo-queries/geo-polygon-query.js
@@ -10,7 +10,7 @@ const GeoQueryBase = require('./geo-query-base');
* [Elasticsearch reference](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-geo-polygon-query.html)
*
* @example
- * const geoQry = bob.geoPolygonQuery('person.location')
+ * const geoQry = esb.geoPolygonQuery('person.location')
* .points([
* {"lat" : 40, "lon" : -70},
* {"lat" : 30, "lon" : -80},
@@ -34,7 +34,7 @@ class GeoPolygonQuery extends GeoQueryBase {
*
* @example
* // Format in `[lon, lat]`
- * const qry = bob.geoPolygonQuery('person.location').points([
+ * const qry = esb.geoPolygonQuery('person.location').points([
* [-70, 40],
* [-80, 30],
* [-90, 20]
@@ -42,7 +42,7 @@ class GeoPolygonQuery extends GeoQueryBase {
*
* @example
* // Format in lat,lon
- * const qry = bob.geoPolygonQuery('person.location').points([
+ * const qry = esb.geoPolygonQuery('person.location').points([
* '40, -70',
* '30, -80',
* '20, -90'
@@ -50,7 +50,7 @@ class GeoPolygonQuery extends GeoQueryBase {
*
* @example
* // Geohash
- * const qry = bob.geoPolygonQuery('person.location').points([
+ * const qry = esb.geoPolygonQuery('person.location').points([
* 'drn5x1g8cu2y',
* '30, -80',
* '20, -90'
diff --git a/src/queries/geo-queries/geo-shape-query.js b/src/queries/geo-queries/geo-shape-query.js
index 39fdffd1..a017f0dd 100644
--- a/src/queries/geo-queries/geo-shape-query.js
+++ b/src/queries/geo-queries/geo-shape-query.js
@@ -36,17 +36,17 @@ const invalidRelationParam = invalidParam(
* [Elasticsearch reference](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-geo-shape-query.html)
*
* @example
- * const geoQry = bob.geoShapeQuery('location')
- * .shape(bob.geoShape()
+ * const geoQry = esb.geoShapeQuery('location')
+ * .shape(esb.geoShape()
* .type('envelope')
* .coordinates([[13.0, 53.0], [14.0, 52.0]]))
* .relation('within');
*
* @example
* // Pre-indexed shape
- * const geoQry = bob.geoShapeQuery()
+ * const geoQry = esb.geoShapeQuery()
* .field('location')
- * .indexedShape(bob.indexedShape()
+ * .indexedShape(esb.indexedShape()
* .id('DEU')
* .type('countries')
* .index('shapes')
diff --git a/src/queries/joining-queries/has-child-query.js b/src/queries/joining-queries/has-child-query.js
index d917ad78..8b1a9fcd 100644
--- a/src/queries/joining-queries/has-child-query.js
+++ b/src/queries/joining-queries/has-child-query.js
@@ -15,17 +15,17 @@ const ES_REF_URL =
*
* @example
* // Scoring support
- * const qry = bob.hasChildQuery(
- * bob.termQuery('tag', 'something'),
+ * const qry = esb.hasChildQuery(
+ * esb.termQuery('tag', 'something'),
* 'blog_tag'
* ).scoreMode('min');
*
* @example
* // Sort by child documents' `click_count` field
- * const qry = bob.hasChildQuery()
+ * const qry = esb.hasChildQuery()
* .query(
- * bob.functionScoreQuery().function(
- * bob.scriptScoreFunction("_score * doc['click_count'].value")
+ * esb.functionScoreQuery().function(
+ * esb.scriptScoreFunction("_score * doc['click_count'].value")
* )
* )
* .type('blog_tag')
@@ -74,7 +74,7 @@ class HasChildQuery extends JoiningQueryBase {
* for the parent doc to be considered a match
*
* @example
- * const qry = bob.hasChildQuery(bob.termQuery('tag', 'something'), 'blog_tag')
+ * const qry = esb.hasChildQuery(esb.termQuery('tag', 'something'), 'blog_tag')
* .minChildren(2)
* .maxChildren(10)
* .scoreMode('min');
@@ -92,7 +92,7 @@ class HasChildQuery extends JoiningQueryBase {
* for the parent doc to be considered a match
*
* @example
- * const qry = bob.hasChildQuery(bob.termQuery('tag', 'something'), 'blog_tag')
+ * const qry = esb.hasChildQuery(esb.termQuery('tag', 'something'), 'blog_tag')
* .minChildren(2)
* .maxChildren(10)
* .scoreMode('min');
diff --git a/src/queries/joining-queries/has-parent-query.js b/src/queries/joining-queries/has-parent-query.js
index 2f70b15f..6e667191 100644
--- a/src/queries/joining-queries/has-parent-query.js
+++ b/src/queries/joining-queries/has-parent-query.js
@@ -16,16 +16,16 @@ const ES_REF_URL =
* [Elasticsearch reference](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-has-parent-query.html)
*
* @example
- * const qry = bob.hasParentQuery(bob.termQuery('tag', 'something'), 'blog');
+ * const qry = esb.hasParentQuery(esb.termQuery('tag', 'something'), 'blog');
*
* @example
* // Sorting tags by parent documents' `view_count` field
- * const qry = bob.hasParentQuery()
+ * const qry = esb.hasParentQuery()
* .parentType('blog')
* .score(true)
* .query(
- * bob.functionScoreQuery().function(
- * bob.scriptScoreFunction("_score * doc['view_count'].value")
+ * esb.functionScoreQuery().function(
+ * esb.scriptScoreFunction("_score * doc['view_count'].value")
* )
* );
*
@@ -81,8 +81,8 @@ class HasParentQuery extends JoiningQueryBase {
* aggregated into the child documents belonging to the matching parent document.
*
* @example
- * const qry = bob.hasParentQuery(
- * bob.termQuery('tag', 'something'),
+ * const qry = esb.hasParentQuery(
+ * esb.termQuery('tag', 'something'),
* 'blog'
* ).score(true);
*
diff --git a/src/queries/joining-queries/joining-query-base.js b/src/queries/joining-queries/joining-query-base.js
index 3f198924..c16dced6 100644
--- a/src/queries/joining-queries/joining-query-base.js
+++ b/src/queries/joining-queries/joining-query-base.js
@@ -61,8 +61,8 @@ class JoiningQueryBase extends Query {
* - `avg` - the default, the average of all matched child documents is used
*
* @example
- * const qry = bob.hasChildQuery(
- * bob.termQuery('tag', 'something'),
+ * const qry = esb.hasChildQuery(
+ * esb.termQuery('tag', 'something'),
* 'blog_tag'
* ).scoreMode('min');
*
diff --git a/src/queries/joining-queries/nested-query.js b/src/queries/joining-queries/nested-query.js
index adb62cba..1dd29b0c 100644
--- a/src/queries/joining-queries/nested-query.js
+++ b/src/queries/joining-queries/nested-query.js
@@ -15,13 +15,13 @@ const ES_REF_URL =
* [Elasticsearch reference](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-nested-query.html)
*
* @example
- * const qry = bob.nestedQuery()
+ * const qry = esb.nestedQuery()
* .path('obj1')
* .scoreMode('avg')
* .query(
- * bob.boolQuery().must([
- * bob.matchQuery('obj1.name', 'blue'),
- * bob.rangeQuery('obj1.count').gt(5)
+ * esb.boolQuery().must([
+ * esb.matchQuery('obj1.name', 'blue'),
+ * esb.rangeQuery('obj1.count').gt(5)
* ])
* );
*
diff --git a/src/queries/joining-queries/parent-id-query.js b/src/queries/joining-queries/parent-id-query.js
index bbfbe478..880d770a 100644
--- a/src/queries/joining-queries/parent-id-query.js
+++ b/src/queries/joining-queries/parent-id-query.js
@@ -10,7 +10,7 @@ const { Query } = require('../../core');
* [Elasticsearch reference](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-parent-id-query.html)
*
* @example
- * const qry = bob.parentIdQuery('blog_tag', 1);
+ * const qry = esb.parentIdQuery('blog_tag', 1);
*
* @param {string=} type The **child** type. This must be a type with `_parent` field.
* @param {string|number=} id The required parent id select documents must refer to.
diff --git a/src/queries/match-all-query.js b/src/queries/match-all-query.js
index 99048bfc..ddcd367d 100644
--- a/src/queries/match-all-query.js
+++ b/src/queries/match-all-query.js
@@ -8,7 +8,7 @@ const { Query } = require('../core');
* [Elasticsearch reference](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-match-all-query.html)
*
* @example
- * const qry = bob.matchAllQuery().boost(1.2);
+ * const qry = esb.matchAllQuery().boost(1.2);
*
* @extends Query
*/
diff --git a/src/queries/match-none-query.js b/src/queries/match-none-query.js
index dd8c5521..b4d94c30 100644
--- a/src/queries/match-none-query.js
+++ b/src/queries/match-none-query.js
@@ -8,7 +8,7 @@ const { Query } = require('../core');
* [Elasticsearch reference](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-match-all-query.html)
*
* @example
- * const qry = bob.matchNoneQuery();
+ * const qry = esb.matchNoneQuery();
*
* @extends Query
*/
diff --git a/src/queries/span-queries/span-containing-query.js b/src/queries/span-queries/span-containing-query.js
index 984ff6ca..d8b521cf 100644
--- a/src/queries/span-queries/span-containing-query.js
+++ b/src/queries/span-queries/span-containing-query.js
@@ -11,12 +11,12 @@ const SpanLittleBigQueryBase = require('./span-little-big-query-base');
* [Elasticsearch reference](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-span-containing-query.html)
*
* @example
- * const spanQry = bob.spanContainingQuery()
- * .little(bob.spanTermQuery('field1', 'foo'))
- * .big(bob.spanNearQuery()
+ * const spanQry = esb.spanContainingQuery()
+ * .little(esb.spanTermQuery('field1', 'foo'))
+ * .big(esb.spanNearQuery()
* .clauses([
- * bob.spanTermQuery('field1', 'bar'),
- * bob.spanTermQuery('field1', 'baz')
+ * esb.spanTermQuery('field1', 'bar'),
+ * esb.spanTermQuery('field1', 'baz')
* ])
* .slop(5)
* .inOrder(true))
diff --git a/src/queries/span-queries/span-field-masking-query.js b/src/queries/span-queries/span-field-masking-query.js
index ab2bb1c7..f3fa9735 100644
--- a/src/queries/span-queries/span-field-masking-query.js
+++ b/src/queries/span-queries/span-field-masking-query.js
@@ -25,12 +25,12 @@ const SpanQueryBase = require('./span-query-base');
* @param {SpanQueryBase=} spanQry Any other span type query
*
* @example
- * const spanQry = bob.spanNearQuery()
+ * const spanQry = esb.spanNearQuery()
* .clauses([
- * bob.spanTermQuery('text', 'quick brown'),
- * bob.spanFieldMaskingQuery()
+ * esb.spanTermQuery('text', 'quick brown'),
+ * esb.spanFieldMaskingQuery()
* .field('text')
- * .query(bob.spanTermQuery('text.stems', 'fox'))
+ * .query(esb.spanTermQuery('text.stems', 'fox'))
* ])
* .slop(5)
* .inOrder(false);
diff --git a/src/queries/span-queries/span-first-query.js b/src/queries/span-queries/span-first-query.js
index dd6962de..fa6cbc15 100644
--- a/src/queries/span-queries/span-first-query.js
+++ b/src/queries/span-queries/span-first-query.js
@@ -12,8 +12,8 @@ const SpanQueryBase = require('./span-query-base');
* [Elasticsearch reference](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-span-first-query.html)
*
* @example
- * const spanQry = bob.spanFirstQuery()
- * .match(bob.spanTermQuery('user', 'kimchy'))
+ * const spanQry = esb.spanFirstQuery()
+ * .match(esb.spanTermQuery('user', 'kimchy'))
* .end(3);
*
* @param {SpanQueryBase=} spanQry Any other span type query
diff --git a/src/queries/span-queries/span-multi-term-query.js b/src/queries/span-queries/span-multi-term-query.js
index c64aa337..1f6ad582 100644
--- a/src/queries/span-queries/span-multi-term-query.js
+++ b/src/queries/span-queries/span-multi-term-query.js
@@ -15,8 +15,8 @@ const SpanQueryBase = require('./span-query-base');
* [Elasticsearch reference](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-span-multi-term-query.html)
*
* @example
- * const spanQry = bob.spanMultiTermQuery()
- * .match(bob.prefixQuery('user', 'ki').boost(1.08));
+ * const spanQry = esb.spanMultiTermQuery()
+ * .match(esb.prefixQuery('user', 'ki').boost(1.08));
*
* @param {MultiTermQueryBase=} multiTermQry One of wildcard, fuzzy, prefix, range or regexp query
*
diff --git a/src/queries/span-queries/span-near-query.js b/src/queries/span-queries/span-near-query.js
index 87216775..d2b6befd 100644
--- a/src/queries/span-queries/span-near-query.js
+++ b/src/queries/span-queries/span-near-query.js
@@ -12,11 +12,11 @@ const SpanQueryBase = require('./span-query-base');
* [Elasticsearch reference](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-span-near-query.html)
*
* @example
- * const spanQry = bob.spanNearQuery()
+ * const spanQry = esb.spanNearQuery()
* .clauses([
- * bob.spanTermQuery('field', 'value1'),
- * bob.spanTermQuery('field', 'value2'),
- * bob.spanTermQuery('field', 'value3')
+ * esb.spanTermQuery('field', 'value1'),
+ * esb.spanTermQuery('field', 'value2'),
+ * esb.spanTermQuery('field', 'value3')
* ])
* .slop(12)
* .inOrder(false);
diff --git a/src/queries/span-queries/span-not-query.js b/src/queries/span-queries/span-not-query.js
index babd20ef..cd552f27 100644
--- a/src/queries/span-queries/span-not-query.js
+++ b/src/queries/span-queries/span-not-query.js
@@ -11,12 +11,12 @@ const SpanQueryBase = require('./span-query-base');
* [Elasticsearch reference](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-span-not-query.html)
*
* @example
- * const spanQry = bob.spanNotQuery()
- * .include(bob.spanTermQuery('field1', 'hoya'))
- * .exclude(bob.spanNearQuery()
+ * const spanQry = esb.spanNotQuery()
+ * .include(esb.spanTermQuery('field1', 'hoya'))
+ * .exclude(esb.spanNearQuery()
* .clauses([
- * bob.spanTermQuery('field1', 'la'),
- * bob.spanTermQuery('field1', 'hoya')
+ * esb.spanTermQuery('field1', 'la'),
+ * esb.spanTermQuery('field1', 'hoya')
* ])
* .slop(0)
* .inOrder(true));
diff --git a/src/queries/span-queries/span-or-query.js b/src/queries/span-queries/span-or-query.js
index c05a6376..e5ed843c 100644
--- a/src/queries/span-queries/span-or-query.js
+++ b/src/queries/span-queries/span-or-query.js
@@ -10,11 +10,11 @@ const SpanQueryBase = require('./span-query-base');
* [Elasticsearch reference](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-span-or-query.html)
*
* @example
- * const spanQry = bob.spanOrQuery()
+ * const spanQry = esb.spanOrQuery()
* .clauses([
- * bob.spanTermQuery('field', 'value1'),
- * bob.spanTermQuery('field', 'value2'),
- * bob.spanTermQuery('field', 'value3')
+ * esb.spanTermQuery('field', 'value1'),
+ * esb.spanTermQuery('field', 'value2'),
+ * esb.spanTermQuery('field', 'value3')
* ]);
*
* @extends SpanQueryBase
diff --git a/src/queries/span-queries/span-term-query.js b/src/queries/span-queries/span-term-query.js
index d7d677b9..e400cf78 100644
--- a/src/queries/span-queries/span-term-query.js
+++ b/src/queries/span-queries/span-term-query.js
@@ -11,10 +11,10 @@ const SpanQueryBase = require('./span-query-base');
* [Elasticsearch reference](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-span-term-query.html)
*
* @example
- * const qry = bob.spanTermQuery('user', 'kimchy');
+ * const qry = esb.spanTermQuery('user', 'kimchy');
*
* @example
- * const qry = bob.spanTermQuery()
+ * const qry = esb.spanTermQuery()
* .field('user')
* .value('kimchy')
* .boost(2.0);
diff --git a/src/queries/span-queries/span-within-query.js b/src/queries/span-queries/span-within-query.js
index 329fa0ae..dd3599ea 100644
--- a/src/queries/span-queries/span-within-query.js
+++ b/src/queries/span-queries/span-within-query.js
@@ -11,12 +11,12 @@ const SpanLittleBigQueryBase = require('./span-little-big-query-base');
* [Elasticsearch reference](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-span-containing-query.html)
*
* @example
- * const spanQry = bob.spanWithinQuery()
- * .little(bob.spanTermQuery('field1', 'foo'))
- * .big(bob.spanNearQuery()
+ * const spanQry = esb.spanWithinQuery()
+ * .little(esb.spanTermQuery('field1', 'foo'))
+ * .big(esb.spanNearQuery()
* .clauses([
- * bob.spanTermQuery('field1', 'bar'),
- * bob.spanTermQuery('field1', 'baz')
+ * esb.spanTermQuery('field1', 'bar'),
+ * esb.spanTermQuery('field1', 'baz')
* ])
* .slop(5)
* .inOrder(true));
diff --git a/src/queries/specialized-queries/more-like-this-query.js b/src/queries/specialized-queries/more-like-this-query.js
index 62a9ec86..ac403693 100644
--- a/src/queries/specialized-queries/more-like-this-query.js
+++ b/src/queries/specialized-queries/more-like-this-query.js
@@ -15,7 +15,7 @@ const { Query, util: { checkType } } = require('../../core');
*
* @example
* // Ask for documents that are similar to a provided piece of text
- * const qry = bob.moreLikeThisQuery()
+ * const qry = esb.moreLikeThisQuery()
* .fields(['title', 'description'])
* .like('Once upon a time')
* .minTermFreq(1)
@@ -23,7 +23,7 @@ const { Query, util: { checkType } } = require('../../core');
*
* @example
* // Mixing texts with documents already existing in the index
- * const qry = bob.moreLikeThisQuery()
+ * const qry = esb.moreLikeThisQuery()
* .fields(['title', 'description'])
* .like({ _index: 'imdb', _type: 'movies', _id: '1' })
* .like({ _index: 'imdb', _type: 'movies', _id: '2' })
@@ -33,7 +33,7 @@ const { Query, util: { checkType } } = require('../../core');
*
* @example
* // Provide documents not present in the index
- * const qry = bob.moreLikeThisQuery()
+ * const qry = esb.moreLikeThisQuery()
* .fields(['name.first', 'name.last'])
* .like([
* {
diff --git a/src/queries/specialized-queries/percolate-query.js b/src/queries/specialized-queries/percolate-query.js
index 86a03ac8..bbb4a3fb 100644
--- a/src/queries/specialized-queries/percolate-query.js
+++ b/src/queries/specialized-queries/percolate-query.js
@@ -12,10 +12,10 @@ const { Query } = require('../../core');
* [Elasticsearch reference](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-percolate-query.html)
*
* @example
- * const percolateQry = bob.percolateQuery('query', 'doctype')
+ * const percolateQry = esb.percolateQuery('query', 'doctype')
* .document({ message: 'A new bonsai tree in the office' });
*
- * const percolateQry = bob.percolateQuery()
+ * const percolateQry = esb.percolateQuery()
* .field('query')
* .documentType('doctype')
* .index('my-index')
diff --git a/src/queries/specialized-queries/script-query.js b/src/queries/specialized-queries/script-query.js
index 1a29767e..f1071cbe 100644
--- a/src/queries/specialized-queries/script-query.js
+++ b/src/queries/specialized-queries/script-query.js
@@ -11,12 +11,12 @@ const { Query, Script, util: { checkType } } = require('../../core');
* [Elasticsearch reference](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-script-query.html)
*
* @example
- * const scriptQry = bob.scriptQuery(bob.script()
+ * const scriptQry = esb.scriptQuery(esb.script()
* .lang('painless')
* .inline("doc['num1'].value > 1"))
*
* // Use in filter context
- * const qry = bob.boolQuery().must(scriptQry);
+ * const qry = esb.boolQuery().must(scriptQry);
*
* @param {Script=} script
*
diff --git a/src/queries/term-level-queries/exists-query.js b/src/queries/term-level-queries/exists-query.js
index f96f159b..e692f4ae 100644
--- a/src/queries/term-level-queries/exists-query.js
+++ b/src/queries/term-level-queries/exists-query.js
@@ -10,10 +10,10 @@ const { Query } = require('../../core');
* [Elasticsearch reference](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-exists-query.html)
*
* @example
- * const qry = bob.existsQuery('user');
+ * const qry = esb.existsQuery('user');
*
* @example
- * const qry = bob.boolQuery().mustNot(bob.existsQuery('user'));
+ * const qry = esb.boolQuery().mustNot(esb.existsQuery('user'));
*
* @param {string=} field
*
diff --git a/src/queries/term-level-queries/fuzzy-query.js b/src/queries/term-level-queries/fuzzy-query.js
index 334ea97f..2213017d 100644
--- a/src/queries/term-level-queries/fuzzy-query.js
+++ b/src/queries/term-level-queries/fuzzy-query.js
@@ -13,11 +13,11 @@ const MultiTermQueryBase = require('./multi-term-query-base');
* [Elasticsearch reference](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-fuzzy-query.html)
*
* @example
- * const qry = bob.fuzzyQuery('user', 'ki');
+ * const qry = esb.fuzzyQuery('user', 'ki');
*
* @example
* // More advanced settings
- * const qry = bob.fuzzyQuery('user', 'ki')
+ * const qry = esb.fuzzyQuery('user', 'ki')
* .fuzziness(2)
* .prefixLength(0)
* .maxExpansions(100)
diff --git a/src/queries/term-level-queries/ids-query.js b/src/queries/term-level-queries/ids-query.js
index 9bfea429..866ee206 100644
--- a/src/queries/term-level-queries/ids-query.js
+++ b/src/queries/term-level-queries/ids-query.js
@@ -11,7 +11,7 @@ const { Query, util: { checkType } } = require('../../core');
* [Elasticsearch reference](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-ids-query.html)
*
* @example
- * const qry = bob.idsQuery('my_type', ['1', '4', '100']);
+ * const qry = esb.idsQuery('my_type', ['1', '4', '100']);
*
* @param {Array|string=} type The elasticsearch doc type
* @param {Array=} ids List of ids to fiter on.
diff --git a/src/queries/term-level-queries/prefix-query.js b/src/queries/term-level-queries/prefix-query.js
index 26460c32..d1b41f82 100644
--- a/src/queries/term-level-queries/prefix-query.js
+++ b/src/queries/term-level-queries/prefix-query.js
@@ -12,7 +12,7 @@ const ES_REF_URL =
* [Elasticsearch reference](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-prefix-query.html)
*
* @example
- * const qry = bob.prefixQuery('user', 'ki').boost(2.0);
+ * const qry = esb.prefixQuery('user', 'ki').boost(2.0);
*
* @param {string=} field
* @param {string|number=} value
diff --git a/src/queries/term-level-queries/range-query.js b/src/queries/term-level-queries/range-query.js
index 25ee4cf6..4973fe92 100644
--- a/src/queries/term-level-queries/range-query.js
+++ b/src/queries/term-level-queries/range-query.js
@@ -26,13 +26,13 @@ const invalidRelationParam = invalidParam(
* @param {string=} field
*
* @example
- * const qry = bob.rangeQuery('age')
+ * const qry = esb.rangeQuery('age')
* .gte(10)
* .lte(20)
* .boost(2.0);
*
* @example
- * const qry = bob.rangeQuery('date').gte('now-1d/d').lt('now/d');
+ * const qry = esb.rangeQuery('date').gte('now-1d/d').lt('now/d');
*
* @extends MultiTermQueryBase
*/
@@ -155,7 +155,7 @@ class RangeQuery extends MultiTermQueryBase {
* If no format is specified, then it will use the first format specified in the field mapping.
*
* @example
- * const qry = bob.rangeQuery('born')
+ * const qry = esb.rangeQuery('born')
* .gte('01/01/2012')
* .lte('2013')
* .format('dd/MM/yyyy||yyyy');
diff --git a/src/queries/term-level-queries/regexp-query.js b/src/queries/term-level-queries/regexp-query.js
index 6ec92740..d97c0845 100644
--- a/src/queries/term-level-queries/regexp-query.js
+++ b/src/queries/term-level-queries/regexp-query.js
@@ -14,7 +14,7 @@ const ES_REF_URL =
* [Elasticsearch reference](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-regexp-query.html)
*
* @example
- * const qry = bob.regexpQuery('name.first', 's.*y').boost(1.2);
+ * const qry = esb.regexpQuery('name.first', 's.*y').boost(1.2);
*
* @param {string=} field
* @param {string|number=} value
@@ -32,7 +32,7 @@ class RegexpQuery extends MultiTermQueryBase {
* `ANYSTRING`, `COMPLEMENT`, `EMPTY`, `INTERSECTION`, `INTERVAL`, or `NONE`.
*
* @example
- * const qry = bob.regexpQuery('name.first', 's.*y')
+ * const qry = esb.regexpQuery('name.first', 's.*y')
* .flags('INTERSECTION|COMPLEMENT|EMPTY');
*
* @param {string} flags `|` separated flags. Possible flags are `ALL` (default),
@@ -50,7 +50,7 @@ class RegexpQuery extends MultiTermQueryBase {
* Defaults to 10000.
*
* @example
- * const qry = bob.regexpQuery('name.first', 's.*y')
+ * const qry = esb.regexpQuery('name.first', 's.*y')
* .flags('INTERSECTION|COMPLEMENT|EMPTY')
* .maxDeterminizedStates(20000);
*
diff --git a/src/queries/term-level-queries/term-query.js b/src/queries/term-level-queries/term-query.js
index 1a44ef1a..eb09cbf1 100644
--- a/src/queries/term-level-queries/term-query.js
+++ b/src/queries/term-level-queries/term-query.js
@@ -9,7 +9,7 @@ const ValueTermQueryBase = require('./value-term-query-base');
* [Elasticsearch reference](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-term-query.html)
*
* @example
- * const termQry = bob.termQuery('user', 'Kimchy');
+ * const termQry = esb.termQuery('user', 'Kimchy');
*
* @param {string=} field
* @param {string|number=} queryVal
diff --git a/src/queries/term-level-queries/terms-query.js b/src/queries/term-level-queries/terms-query.js
index 7d1240ea..6b5d1b13 100644
--- a/src/queries/term-level-queries/terms-query.js
+++ b/src/queries/term-level-queries/terms-query.js
@@ -12,12 +12,12 @@ const { Query } = require('../../core');
* [Elasticsearch reference](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-terms-query.html)
*
* @example
- * const qry = bob.constantScoreQuery(
- * bob.termsQuery('user', ['kimchy', 'elasticsearch'])
+ * const qry = esb.constantScoreQuery(
+ * esb.termsQuery('user', ['kimchy', 'elasticsearch'])
* );
*
* @example
- * const qry = bob.termsQuery('user')
+ * const qry = esb.termsQuery('user')
* .index('users')
* .type('user')
* .id(2)
diff --git a/src/queries/term-level-queries/type-query.js b/src/queries/term-level-queries/type-query.js
index 2a536750..6bbd0cd8 100644
--- a/src/queries/term-level-queries/type-query.js
+++ b/src/queries/term-level-queries/type-query.js
@@ -10,7 +10,7 @@ const { Query } = require('../../core');
* [Elasticsearch reference](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-type-query.html)
*
* @example
- * const qry = bob.typeQuery('my_type');
+ * const qry = esb.typeQuery('my_type');
*
* @param {string=} type The elasticsearch doc type
*
diff --git a/src/queries/term-level-queries/wildcard-query.js b/src/queries/term-level-queries/wildcard-query.js
index 2a06d76d..7404645e 100644
--- a/src/queries/term-level-queries/wildcard-query.js
+++ b/src/queries/term-level-queries/wildcard-query.js
@@ -12,7 +12,7 @@ const ES_REF_URL =
* [Elasticsearch reference](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-wildcard-query.html)
*
* @example
- * const qry = bob.wildcardQuery('user', 'ki*y').boost(2.0);
+ * const qry = esb.wildcardQuery('user', 'ki*y').boost(2.0);
*
* @param {string=} field
* @param {string=} value
diff --git a/src/recipes.js b/src/recipes.js
index 81a87850..32b09242 100644
--- a/src/recipes.js
+++ b/src/recipes.js
@@ -17,12 +17,12 @@ const { Query, util: { checkType } } = require('./core');
/**
* Recipe for the now removed `missing` query.
*
- * Can be accessed using `bob.recipes.missingQuery` OR `bob.cookMissingQuery`.
+ * Can be accessed using `esb.recipes.missingQuery` OR `esb.cookMissingQuery`.
*
* [Elasticsearch refererence](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-exists-query.html#_literal_missing_literal_query)
*
* @example
- * const qry = bob.cookMissingQuery('user');
+ * const qry = esb.cookMissingQuery('user');
*
* qry.toJSON();
* {
@@ -46,13 +46,13 @@ exports.missingQuery = function missingQuery(field) {
* Recipe for random sort query. Takes a query and returns the same
* wrapped in a random scoring query.
*
- * Can be accessed using `bob.recipes.randomSortQuery` OR `bob.cookRandomSortQuery`.
+ * Can be accessed using `esb.recipes.randomSortQuery` OR `esb.cookRandomSortQuery`.
*
* [Elasticsearch reference](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-function-score-query.html#function-random)
*
* @example
- * const reqBody = bob.requestBodySearch()
- * .query(bob.cookRandomSortQuery(bob.rangeQuery('age').gte(10)))
+ * const reqBody = esb.requestBodySearch()
+ * .query(esb.cookRandomSortQuery(esb.rangeQuery('age').gte(10)))
* .size(100);
*
* reqBody.toJSON();
@@ -88,12 +88,12 @@ exports.randomSortQuery = function randomSortQuery(
* Recipe for constructing a filter query using `bool` query.
* Optionally, scoring can be enabled.
*
- * Can be accessed using `bob.recipes.filterQuery` OR `bob.cookFilterQuery`.
+ * Can be accessed using `esb.recipes.filterQuery` OR `esb.cookFilterQuery`.
*
* [Elasticsearch reference](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-bool-query.html)
*
* @example
- * const boolQry = bob.cookFilterQuery(bob.termQuery('status', 'active'), true);
+ * const boolQry = esb.cookFilterQuery(esb.termQuery('status', 'active'), true);
* boolQry.toJSON();
* {
* "bool": {
diff --git a/src/suggesters/completion-suggester.js b/src/suggesters/completion-suggester.js
index 6ea31f80..48eae9f4 100644
--- a/src/suggesters/completion-suggester.js
+++ b/src/suggesters/completion-suggester.js
@@ -22,10 +22,10 @@ const { Suggester, util: { setDefault } } = require('../core');
* - [Context Suggester](https://www.elastic.co/guide/en/elasticsearch/reference/current/suggester-context.html)
*
* @example
- * const suggest = bob.completionSuggester('song-suggest', 'suggest').prefix('nir');
+ * const suggest = esb.completionSuggester('song-suggest', 'suggest').prefix('nir');
*
* @example
- * const suggest = new bob.CompletionSuggester('place_suggestion', 'suggest')
+ * const suggest = new esb.CompletionSuggester('place_suggestion', 'suggest')
* .prefix('tim')
* .size(10)
* .contexts('place_type', ['cafe', 'restaurants']);
@@ -84,7 +84,7 @@ class CompletionSuggester extends Suggester {
* the same as another string.
*
* @example
- * const suggest = bob.completionSuggester('song-suggest', 'suggest')
+ * const suggest = esb.completionSuggester('song-suggest', 'suggest')
* .prefix('nor')
* .fuzziness(2);
*
@@ -163,7 +163,7 @@ class CompletionSuggester extends Suggester {
* Sets the regular expression for completion suggester which supports regex queries.
*
* @example
- * const suggest = bob.completionSuggester('song-suggest', 'suggest')
+ * const suggest = esb.completionSuggester('song-suggest', 'suggest')
* .regex('n[ever|i]r');
*
* @param {string} expr Regular expression
@@ -216,7 +216,7 @@ class CompletionSuggester extends Suggester {
* [Elasticsearch reference](https://www.elastic.co/guide/en/elasticsearch/reference/current/suggester-context.html)
*
* @example
- * const suggest = new bob.CompletionSuggester('place_suggestion', 'suggest')
+ * const suggest = new esb.CompletionSuggester('place_suggestion', 'suggest')
* .prefix('tim')
* .size(10)
* .contexts('place_type', [
@@ -228,7 +228,7 @@ class CompletionSuggester extends Suggester {
* // Suggestions can be filtered and boosted with respect to how close they
* // are to one or more geo points. The following filters suggestions that
* // fall within the area represented by the encoded geohash of a geo point:
- * const suggest = new bob.CompletionSuggester('place_suggestion', 'suggest')
+ * const suggest = new esb.CompletionSuggester('place_suggestion', 'suggest')
* .prefix('tim')
* .size(10)
* .contexts('location', { lat: 43.662, lon: -79.38 });
@@ -236,7 +236,7 @@ class CompletionSuggester extends Suggester {
* @example
* // Suggestions that are within an area represented by a geohash can also be
* // boosted higher than others
- * const suggest = new bob.CompletionSuggester('place_suggestion', 'suggest')
+ * const suggest = new esb.CompletionSuggester('place_suggestion', 'suggest')
* .prefix('tim')
* .size(10)
* .contexts('location', [
diff --git a/src/suggesters/phrase-suggester.js b/src/suggesters/phrase-suggester.js
index 0d50689c..0e11edb3 100644
--- a/src/suggesters/phrase-suggester.js
+++ b/src/suggesters/phrase-suggester.js
@@ -28,14 +28,14 @@ const invalidSmoothingModeParam = invalidParam(
* [Elasticsearch reference](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-suggesters-phrase.html)
*
* @example
- * const suggest = bob.phraseSuggester(
+ * const suggest = esb.phraseSuggester(
* 'simple_phrase',
* 'title.trigram',
* 'noble prize'
* )
* .size(1)
* .gramSize(3)
- * .directGenerator(bob.directGenerator('title.trigram').suggestMode('always'))
+ * .directGenerator(esb.directGenerator('title.trigram').suggestMode('always'))
* .highlight('', '');
*
* @param {string} name The name of the Suggester, an arbitrary identifier
@@ -161,10 +161,10 @@ class PhraseSuggester extends AnalyzedSuggesterBase {
* for prune is `false`.
*
* @example
- * const suggest = bob.phraseSuggester('simple_phrase', 'title.trigram')
+ * const suggest = esb.phraseSuggester('simple_phrase', 'title.trigram')
* .size(1)
* .directGenerator(
- * bob.directGenerator('title.trigram')
+ * esb.directGenerator('title.trigram')
* .suggestMode('always')
* .minWordLength(1)
* )
@@ -243,11 +243,11 @@ class PhraseSuggester extends AnalyzedSuggesterBase {
* candidates from the other terms to for suggestion candidates.
*
* @example
- * const suggest = bob.phraseSuggester('simple_phrase', 'title.trigram')
+ * const suggest = esb.phraseSuggester('simple_phrase', 'title.trigram')
* .size(1)
* .directGenerator([
- * bob.directGenerator('title.trigram').suggestMode('always'),
- * bob.directGenerator('title.reverse')
+ * esb.directGenerator('title.trigram').suggestMode('always'),
+ * esb.directGenerator('title.reverse')
* .suggestMode('always')
* .preFilter('reverse')
* .postFilter('reverse')
diff --git a/src/suggesters/term-suggester.js b/src/suggesters/term-suggester.js
index ec41000a..5d0824bd 100644
--- a/src/suggesters/term-suggester.js
+++ b/src/suggesters/term-suggester.js
@@ -37,7 +37,7 @@ const invalidStringDistanceParam = invalidParam(
* [Elasticsearch reference](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-suggesters-term.html)
*
* @example
- * const suggest = bob.termSuggester(
+ * const suggest = esb.termSuggester(
* 'my-suggestion',
* 'message',
* 'tring out Elasticsearch'
diff --git a/test/index.test.js b/test/index.test.js
index cd7e3bdc..8e665176 100644
--- a/test/index.test.js
+++ b/test/index.test.js
@@ -1,9 +1,9 @@
import test from 'ava';
-import * as bob from '../src';
+import * as esb from '../src';
test('request body search is exported', t => {
- t.truthy(bob.RequestBodySearch);
- t.truthy(bob.requestBodySearch);
+ t.truthy(esb.RequestBodySearch);
+ t.truthy(esb.requestBodySearch);
});
/* eslint-disable max-statements */
@@ -11,393 +11,393 @@ test('queries are exported', t => {
/* ============ ============ ============ */
/* ============== Queries =============== */
/* ============ ============ ============ */
- t.truthy(bob.MatchAllQuery);
- t.truthy(bob.matchAllQuery);
+ t.truthy(esb.MatchAllQuery);
+ t.truthy(esb.matchAllQuery);
- t.truthy(bob.MatchNoneQuery);
- t.truthy(bob.matchNoneQuery);
+ t.truthy(esb.MatchNoneQuery);
+ t.truthy(esb.matchNoneQuery);
/* ============ ============ ============ */
/* ========== Full Text Queries ========= */
/* ============ ============ ============ */
- t.truthy(bob.MatchQuery);
- t.truthy(bob.matchQuery);
+ t.truthy(esb.MatchQuery);
+ t.truthy(esb.matchQuery);
- t.truthy(bob.MatchPhraseQuery);
- t.truthy(bob.matchPhraseQuery);
+ t.truthy(esb.MatchPhraseQuery);
+ t.truthy(esb.matchPhraseQuery);
- t.truthy(bob.MatchPhrasePrefixQuery);
- t.truthy(bob.matchPhrasePrefixQuery);
+ t.truthy(esb.MatchPhrasePrefixQuery);
+ t.truthy(esb.matchPhrasePrefixQuery);
- t.truthy(bob.MultiMatchQuery);
- t.truthy(bob.multiMatchQuery);
+ t.truthy(esb.MultiMatchQuery);
+ t.truthy(esb.multiMatchQuery);
- t.truthy(bob.CommonTermsQuery);
- t.truthy(bob.commonTermsQuery);
+ t.truthy(esb.CommonTermsQuery);
+ t.truthy(esb.commonTermsQuery);
- t.truthy(bob.QueryStringQuery);
- t.truthy(bob.queryStringQuery);
+ t.truthy(esb.QueryStringQuery);
+ t.truthy(esb.queryStringQuery);
- t.truthy(bob.SimpleQueryStringQuery);
- t.truthy(bob.simpleQueryStringQuery);
+ t.truthy(esb.SimpleQueryStringQuery);
+ t.truthy(esb.simpleQueryStringQuery);
/* ============ ============ ============ */
/* ========= Term Level Queries ========= */
/* ============ ============ ============ */
- t.truthy(bob.TermQuery);
- t.truthy(bob.termQuery);
+ t.truthy(esb.TermQuery);
+ t.truthy(esb.termQuery);
- t.truthy(bob.TermsQuery);
- t.truthy(bob.termsQuery);
+ t.truthy(esb.TermsQuery);
+ t.truthy(esb.termsQuery);
- t.truthy(bob.RangeQuery);
- t.truthy(bob.rangeQuery);
+ t.truthy(esb.RangeQuery);
+ t.truthy(esb.rangeQuery);
- t.truthy(bob.ExistsQuery);
- t.truthy(bob.existsQuery);
+ t.truthy(esb.ExistsQuery);
+ t.truthy(esb.existsQuery);
- t.truthy(bob.PrefixQuery);
- t.truthy(bob.prefixQuery);
+ t.truthy(esb.PrefixQuery);
+ t.truthy(esb.prefixQuery);
- t.truthy(bob.WildcardQuery);
- t.truthy(bob.wildcardQuery);
+ t.truthy(esb.WildcardQuery);
+ t.truthy(esb.wildcardQuery);
- t.truthy(bob.RegexpQuery);
- t.truthy(bob.regexpQuery);
+ t.truthy(esb.RegexpQuery);
+ t.truthy(esb.regexpQuery);
- t.truthy(bob.FuzzyQuery);
- t.truthy(bob.fuzzyQuery);
+ t.truthy(esb.FuzzyQuery);
+ t.truthy(esb.fuzzyQuery);
- t.truthy(bob.TypeQuery);
- t.truthy(bob.typeQuery);
+ t.truthy(esb.TypeQuery);
+ t.truthy(esb.typeQuery);
- t.truthy(bob.IdsQuery);
- t.truthy(bob.idsQuery);
+ t.truthy(esb.IdsQuery);
+ t.truthy(esb.idsQuery);
/* ============ ============ ============ */
/* ========== Compound Queries ========== */
/* ============ ============ ============ */
- t.truthy(bob.ConstantScoreQuery);
- t.truthy(bob.constantScoreQuery);
+ t.truthy(esb.ConstantScoreQuery);
+ t.truthy(esb.constantScoreQuery);
- t.truthy(bob.BoolQuery);
- t.truthy(bob.boolQuery);
+ t.truthy(esb.BoolQuery);
+ t.truthy(esb.boolQuery);
- t.truthy(bob.DisMaxQuery);
- t.truthy(bob.disMaxQuery);
+ t.truthy(esb.DisMaxQuery);
+ t.truthy(esb.disMaxQuery);
- t.truthy(bob.FunctionScoreQuery);
- t.truthy(bob.functionScoreQuery);
+ t.truthy(esb.FunctionScoreQuery);
+ t.truthy(esb.functionScoreQuery);
- t.truthy(bob.BoostingQuery);
- t.truthy(bob.boostingQuery);
+ t.truthy(esb.BoostingQuery);
+ t.truthy(esb.boostingQuery);
/* ============ ============ ============ */
/* =========== Joining Queries ========== */
/* ============ ============ ============ */
- t.truthy(bob.NestedQuery);
- t.truthy(bob.nestedQuery);
+ t.truthy(esb.NestedQuery);
+ t.truthy(esb.nestedQuery);
- t.truthy(bob.HasChildQuery);
- t.truthy(bob.hasChildQuery);
+ t.truthy(esb.HasChildQuery);
+ t.truthy(esb.hasChildQuery);
- t.truthy(bob.HasParentQuery);
- t.truthy(bob.hasParentQuery);
+ t.truthy(esb.HasParentQuery);
+ t.truthy(esb.hasParentQuery);
- t.truthy(bob.ParentIdQuery);
- t.truthy(bob.parentIdQuery);
+ t.truthy(esb.ParentIdQuery);
+ t.truthy(esb.parentIdQuery);
/* ============ ============ ============ */
/* ============ Geo Queries ============= */
/* ============ ============ ============ */
- t.truthy(bob.GeoShapeQuery);
- t.truthy(bob.geoShapeQuery);
+ t.truthy(esb.GeoShapeQuery);
+ t.truthy(esb.geoShapeQuery);
- t.truthy(bob.GeoBoundingBoxQuery);
- t.truthy(bob.geoBoundingBoxQuery);
+ t.truthy(esb.GeoBoundingBoxQuery);
+ t.truthy(esb.geoBoundingBoxQuery);
- t.truthy(bob.GeoDistanceQuery);
- t.truthy(bob.geoDistanceQuery);
+ t.truthy(esb.GeoDistanceQuery);
+ t.truthy(esb.geoDistanceQuery);
- t.truthy(bob.GeoPolygonQuery);
- t.truthy(bob.geoPolygonQuery);
+ t.truthy(esb.GeoPolygonQuery);
+ t.truthy(esb.geoPolygonQuery);
/* ============ ============ ============ */
/* ======== Specialized Queries ========= */
/* ============ ============ ============ */
- t.truthy(bob.MoreLikeThisQuery);
- t.truthy(bob.moreLikeThisQuery);
+ t.truthy(esb.MoreLikeThisQuery);
+ t.truthy(esb.moreLikeThisQuery);
- t.truthy(bob.ScriptQuery);
- t.truthy(bob.scriptQuery);
+ t.truthy(esb.ScriptQuery);
+ t.truthy(esb.scriptQuery);
- t.truthy(bob.PercolateQuery);
- t.truthy(bob.percolateQuery);
+ t.truthy(esb.PercolateQuery);
+ t.truthy(esb.percolateQuery);
/* ============ ============ ============ */
/* ============ Span Queries ============ */
/* ============ ============ ============ */
- t.truthy(bob.SpanTermQuery);
- t.truthy(bob.spanTermQuery);
+ t.truthy(esb.SpanTermQuery);
+ t.truthy(esb.spanTermQuery);
- t.truthy(bob.SpanMultiTermQuery);
- t.truthy(bob.spanMultiTermQuery);
+ t.truthy(esb.SpanMultiTermQuery);
+ t.truthy(esb.spanMultiTermQuery);
- t.truthy(bob.SpanFirstQuery);
- t.truthy(bob.spanFirstQuery);
+ t.truthy(esb.SpanFirstQuery);
+ t.truthy(esb.spanFirstQuery);
- t.truthy(bob.SpanNearQuery);
- t.truthy(bob.spanNearQuery);
+ t.truthy(esb.SpanNearQuery);
+ t.truthy(esb.spanNearQuery);
- t.truthy(bob.SpanOrQuery);
- t.truthy(bob.spanOrQuery);
+ t.truthy(esb.SpanOrQuery);
+ t.truthy(esb.spanOrQuery);
- t.truthy(bob.SpanNotQuery);
- t.truthy(bob.spanNotQuery);
+ t.truthy(esb.SpanNotQuery);
+ t.truthy(esb.spanNotQuery);
- t.truthy(bob.SpanContainingQuery);
- t.truthy(bob.spanContainingQuery);
+ t.truthy(esb.SpanContainingQuery);
+ t.truthy(esb.spanContainingQuery);
- t.truthy(bob.SpanWithinQuery);
- t.truthy(bob.spanWithinQuery);
+ t.truthy(esb.SpanWithinQuery);
+ t.truthy(esb.spanWithinQuery);
- t.truthy(bob.SpanFieldMaskingQuery);
- t.truthy(bob.spanFieldMaskingQuery);
+ t.truthy(esb.SpanFieldMaskingQuery);
+ t.truthy(esb.spanFieldMaskingQuery);
});
test('aggregations are exported', t => {
/* ============ ============ ============ */
/* ======== Metrics Aggregations ======== */
/* ============ ============ ============ */
- t.truthy(bob.AvgAggregation);
- t.truthy(bob.avgAggregation);
+ t.truthy(esb.AvgAggregation);
+ t.truthy(esb.avgAggregation);
- t.truthy(bob.CardinalityAggregation);
- t.truthy(bob.cardinalityAggregation);
+ t.truthy(esb.CardinalityAggregation);
+ t.truthy(esb.cardinalityAggregation);
- t.truthy(bob.ExtendedStatsAggregation);
- t.truthy(bob.extendedStatsAggregation);
+ t.truthy(esb.ExtendedStatsAggregation);
+ t.truthy(esb.extendedStatsAggregation);
- t.truthy(bob.GeoBoundsAggregation);
- t.truthy(bob.geoBoundsAggregation);
+ t.truthy(esb.GeoBoundsAggregation);
+ t.truthy(esb.geoBoundsAggregation);
- t.truthy(bob.GeoCentroidAggregation);
- t.truthy(bob.geoCentroidAggregation);
+ t.truthy(esb.GeoCentroidAggregation);
+ t.truthy(esb.geoCentroidAggregation);
- t.truthy(bob.MaxAggregation);
- t.truthy(bob.maxAggregation);
+ t.truthy(esb.MaxAggregation);
+ t.truthy(esb.maxAggregation);
- t.truthy(bob.MinAggregation);
- t.truthy(bob.minAggregation);
+ t.truthy(esb.MinAggregation);
+ t.truthy(esb.minAggregation);
- t.truthy(bob.PercentilesAggregation);
- t.truthy(bob.percentilesAggregation);
+ t.truthy(esb.PercentilesAggregation);
+ t.truthy(esb.percentilesAggregation);
- t.truthy(bob.PercentileRanksAggregation);
- t.truthy(bob.percentileRanksAggregation);
+ t.truthy(esb.PercentileRanksAggregation);
+ t.truthy(esb.percentileRanksAggregation);
- t.truthy(bob.ScriptedMetricAggregation);
- t.truthy(bob.scriptedMetricAggregation);
+ t.truthy(esb.ScriptedMetricAggregation);
+ t.truthy(esb.scriptedMetricAggregation);
- t.truthy(bob.StatsAggregation);
- t.truthy(bob.statsAggregation);
+ t.truthy(esb.StatsAggregation);
+ t.truthy(esb.statsAggregation);
- t.truthy(bob.SumAggregation);
- t.truthy(bob.sumAggregation);
+ t.truthy(esb.SumAggregation);
+ t.truthy(esb.sumAggregation);
- t.truthy(bob.TopHitsAggregation);
- t.truthy(bob.topHitsAggregation);
+ t.truthy(esb.TopHitsAggregation);
+ t.truthy(esb.topHitsAggregation);
- t.truthy(bob.ValueCountAggregation);
- t.truthy(bob.valueCountAggregation);
+ t.truthy(esb.ValueCountAggregation);
+ t.truthy(esb.valueCountAggregation);
/* ============ ============ ============ */
/* ========= Bucket Aggregations ======== */
/* ============ ============ ============ */
- t.truthy(bob.AdjacencyMatrixAggregation);
- t.truthy(bob.adjacencyMatrixAggregation);
+ t.truthy(esb.AdjacencyMatrixAggregation);
+ t.truthy(esb.adjacencyMatrixAggregation);
- t.truthy(bob.ChildrenAggregation);
- t.truthy(bob.childrenAggregation);
+ t.truthy(esb.ChildrenAggregation);
+ t.truthy(esb.childrenAggregation);
- t.truthy(bob.DateHistogramAggregation);
- t.truthy(bob.dateHistogramAggregation);
+ t.truthy(esb.DateHistogramAggregation);
+ t.truthy(esb.dateHistogramAggregation);
- t.truthy(bob.DateRangeAggregation);
- t.truthy(bob.dateRangeAggregation);
+ t.truthy(esb.DateRangeAggregation);
+ t.truthy(esb.dateRangeAggregation);
- t.truthy(bob.DiversifiedSamplerAggregation);
- t.truthy(bob.diversifiedSamplerAggregation);
+ t.truthy(esb.DiversifiedSamplerAggregation);
+ t.truthy(esb.diversifiedSamplerAggregation);
- t.truthy(bob.FilterAggregation);
- t.truthy(bob.filterAggregation);
+ t.truthy(esb.FilterAggregation);
+ t.truthy(esb.filterAggregation);
- t.truthy(bob.FiltersAggregation);
- t.truthy(bob.filtersAggregation);
+ t.truthy(esb.FiltersAggregation);
+ t.truthy(esb.filtersAggregation);
- t.truthy(bob.GeoDistanceAggregation);
- t.truthy(bob.geoDistanceAggregation);
+ t.truthy(esb.GeoDistanceAggregation);
+ t.truthy(esb.geoDistanceAggregation);
- t.truthy(bob.GeoHashGridAggregation);
- t.truthy(bob.geoHashGridAggregation);
+ t.truthy(esb.GeoHashGridAggregation);
+ t.truthy(esb.geoHashGridAggregation);
- t.truthy(bob.GlobalAggregation);
- t.truthy(bob.globalAggregation);
+ t.truthy(esb.GlobalAggregation);
+ t.truthy(esb.globalAggregation);
- t.truthy(bob.HistogramAggregation);
- t.truthy(bob.histogramAggregation);
+ t.truthy(esb.HistogramAggregation);
+ t.truthy(esb.histogramAggregation);
- t.truthy(bob.IpRangeAggregation);
- t.truthy(bob.ipRangeAggregation);
+ t.truthy(esb.IpRangeAggregation);
+ t.truthy(esb.ipRangeAggregation);
- t.truthy(bob.MissingAggregation);
- t.truthy(bob.missingAggregation);
+ t.truthy(esb.MissingAggregation);
+ t.truthy(esb.missingAggregation);
- t.truthy(bob.NestedAggregation);
- t.truthy(bob.nestedAggregation);
+ t.truthy(esb.NestedAggregation);
+ t.truthy(esb.nestedAggregation);
- t.truthy(bob.RangeAggregation);
- t.truthy(bob.rangeAggregation);
+ t.truthy(esb.RangeAggregation);
+ t.truthy(esb.rangeAggregation);
- t.truthy(bob.ReverseNestedAggregation);
- t.truthy(bob.reverseNestedAggregation);
+ t.truthy(esb.ReverseNestedAggregation);
+ t.truthy(esb.reverseNestedAggregation);
- t.truthy(bob.SamplerAggregation);
- t.truthy(bob.samplerAggregation);
+ t.truthy(esb.SamplerAggregation);
+ t.truthy(esb.samplerAggregation);
- t.truthy(bob.SignificantTermsAggregation);
- t.truthy(bob.significantTermsAggregation);
+ t.truthy(esb.SignificantTermsAggregation);
+ t.truthy(esb.significantTermsAggregation);
- t.truthy(bob.TermsAggregation);
- t.truthy(bob.termsAggregation);
+ t.truthy(esb.TermsAggregation);
+ t.truthy(esb.termsAggregation);
/* ============ ============ ============ */
/* ======== Pipeline Aggregations ======= */
/* ============ ============ ============ */
- t.truthy(bob.AvgBucketAggregation);
- t.truthy(bob.avgBucketAggregation);
+ t.truthy(esb.AvgBucketAggregation);
+ t.truthy(esb.avgBucketAggregation);
- t.truthy(bob.DerivativeAggregation);
- t.truthy(bob.derivativeAggregation);
+ t.truthy(esb.DerivativeAggregation);
+ t.truthy(esb.derivativeAggregation);
- t.truthy(bob.MaxBucketAggregation);
- t.truthy(bob.maxBucketAggregation);
+ t.truthy(esb.MaxBucketAggregation);
+ t.truthy(esb.maxBucketAggregation);
- t.truthy(bob.MinBucketAggregation);
- t.truthy(bob.minBucketAggregation);
+ t.truthy(esb.MinBucketAggregation);
+ t.truthy(esb.minBucketAggregation);
- t.truthy(bob.SumBucketAggregation);
- t.truthy(bob.sumBucketAggregation);
+ t.truthy(esb.SumBucketAggregation);
+ t.truthy(esb.sumBucketAggregation);
- t.truthy(bob.StatsBucketAggregation);
- t.truthy(bob.statsBucketAggregation);
+ t.truthy(esb.StatsBucketAggregation);
+ t.truthy(esb.statsBucketAggregation);
- t.truthy(bob.ExtendedStatsBucketAggregation);
- t.truthy(bob.extendedStatsBucketAggregation);
+ t.truthy(esb.ExtendedStatsBucketAggregation);
+ t.truthy(esb.extendedStatsBucketAggregation);
- t.truthy(bob.PercentilesBucketAggregation);
- t.truthy(bob.percentilesBucketAggregation);
+ t.truthy(esb.PercentilesBucketAggregation);
+ t.truthy(esb.percentilesBucketAggregation);
- t.truthy(bob.MovingAverageAggregation);
- t.truthy(bob.movingAverageAggregation);
+ t.truthy(esb.MovingAverageAggregation);
+ t.truthy(esb.movingAverageAggregation);
- t.truthy(bob.CumulativeSumAggregation);
- t.truthy(bob.cumulativeSumAggregation);
+ t.truthy(esb.CumulativeSumAggregation);
+ t.truthy(esb.cumulativeSumAggregation);
- t.truthy(bob.BucketScriptAggregation);
- t.truthy(bob.bucketScriptAggregation);
+ t.truthy(esb.BucketScriptAggregation);
+ t.truthy(esb.bucketScriptAggregation);
- t.truthy(bob.BucketSelectorAggregation);
- t.truthy(bob.bucketSelectorAggregation);
+ t.truthy(esb.BucketSelectorAggregation);
+ t.truthy(esb.bucketSelectorAggregation);
- t.truthy(bob.SerialDifferencingAggregation);
- t.truthy(bob.serialDifferencingAggregation);
+ t.truthy(esb.SerialDifferencingAggregation);
+ t.truthy(esb.serialDifferencingAggregation);
/* ============ ============ ============ */
/* ========= Matrix Aggregations ======== */
/* ============ ============ ============ */
- t.truthy(bob.MatrixStatsAggregation);
- t.truthy(bob.matrixStatsAggregation);
+ t.truthy(esb.MatrixStatsAggregation);
+ t.truthy(esb.matrixStatsAggregation);
});
test('suggesters are exported', t => {
- t.truthy(bob.TermSuggester);
- t.truthy(bob.termSuggester);
+ t.truthy(esb.TermSuggester);
+ t.truthy(esb.termSuggester);
- t.truthy(bob.DirectGenerator);
- t.truthy(bob.directGenerator);
+ t.truthy(esb.DirectGenerator);
+ t.truthy(esb.directGenerator);
- t.truthy(bob.PhraseSuggester);
- t.truthy(bob.phraseSuggester);
+ t.truthy(esb.PhraseSuggester);
+ t.truthy(esb.phraseSuggester);
- t.truthy(bob.CompletionSuggester);
- t.truthy(bob.completionSuggester);
+ t.truthy(esb.CompletionSuggester);
+ t.truthy(esb.completionSuggester);
});
test('score functions are exported', t => {
/* ============ ============ ============ */
/* ========== Score Functions =========== */
/* ============ ============ ============ */
- t.truthy(bob.ScriptScoreFunction);
- t.truthy(bob.scriptScoreFunction);
+ t.truthy(esb.ScriptScoreFunction);
+ t.truthy(esb.scriptScoreFunction);
- t.truthy(bob.WeightScoreFunction);
- t.truthy(bob.weightScoreFunction);
+ t.truthy(esb.WeightScoreFunction);
+ t.truthy(esb.weightScoreFunction);
- t.truthy(bob.RandomScoreFunction);
- t.truthy(bob.randomScoreFunction);
+ t.truthy(esb.RandomScoreFunction);
+ t.truthy(esb.randomScoreFunction);
- t.truthy(bob.FieldValueFactorFunction);
- t.truthy(bob.fieldValueFactorFunction);
+ t.truthy(esb.FieldValueFactorFunction);
+ t.truthy(esb.fieldValueFactorFunction);
- t.truthy(bob.DecayScoreFunction);
- t.truthy(bob.decayScoreFunction);
+ t.truthy(esb.DecayScoreFunction);
+ t.truthy(esb.decayScoreFunction);
});
test('misc are exported', t => {
/* ============ ============ ============ */
/* ============ Miscellaneous =========== */
/* ============ ============ ============ */
- t.truthy(bob.recipes);
- t.truthy(bob.recipes.missingQuery);
- t.truthy(bob.recipes.randomSortQuery);
- t.truthy(bob.recipes.filterQuery);
- t.truthy(bob.cookMissingQuery);
- t.truthy(bob.cookRandomSortQuery);
- t.truthy(bob.cookFilterQuery);
+ t.truthy(esb.recipes);
+ t.truthy(esb.recipes.missingQuery);
+ t.truthy(esb.recipes.randomSortQuery);
+ t.truthy(esb.recipes.filterQuery);
+ t.truthy(esb.cookMissingQuery);
+ t.truthy(esb.cookRandomSortQuery);
+ t.truthy(esb.cookFilterQuery);
- t.truthy(bob.Highlight);
- t.truthy(bob.highlight);
+ t.truthy(esb.Highlight);
+ t.truthy(esb.highlight);
- t.truthy(bob.Script);
- t.truthy(bob.script);
+ t.truthy(esb.Script);
+ t.truthy(esb.script);
- t.truthy(bob.GeoPoint);
- t.truthy(bob.geoPoint);
+ t.truthy(esb.GeoPoint);
+ t.truthy(esb.geoPoint);
- t.truthy(bob.GeoShape);
- t.truthy(bob.geoShape);
+ t.truthy(esb.GeoShape);
+ t.truthy(esb.geoShape);
- t.truthy(bob.IndexedShape);
- t.truthy(bob.indexedShape);
+ t.truthy(esb.IndexedShape);
+ t.truthy(esb.indexedShape);
- t.truthy(bob.Sort);
- t.truthy(bob.sort);
+ t.truthy(esb.Sort);
+ t.truthy(esb.sort);
- t.truthy(bob.Rescore);
- t.truthy(bob.rescore);
+ t.truthy(esb.Rescore);
+ t.truthy(esb.rescore);
- t.truthy(bob.InnerHits);
- t.truthy(bob.innerHits);
+ t.truthy(esb.InnerHits);
+ t.truthy(esb.innerHits);
- t.truthy(bob.SearchTemplate);
- t.truthy(bob.searchTemplate);
+ t.truthy(esb.SearchTemplate);
+ t.truthy(esb.searchTemplate);
- t.truthy(bob.prettyPrint);
+ t.truthy(esb.prettyPrint);
});
test('pretty print calls toJSON', t => {
- bob.prettyPrint({
+ esb.prettyPrint({
toJSON() {
t.pass();
return true;
diff --git a/test/recipes.test.js b/test/recipes.test.js
index a43d298e..67983b2a 100644
--- a/test/recipes.test.js
+++ b/test/recipes.test.js
@@ -1,11 +1,11 @@
import test from 'ava';
-import * as bob from '../src';
+import * as esb from '../src';
import { illegalParamType } from './_macros';
test('missing query recipe', t => {
- t.is(bob.recipes.missingQuery, bob.cookMissingQuery);
+ t.is(esb.recipes.missingQuery, esb.cookMissingQuery);
- const value = bob.recipes.missingQuery('my_field');
+ const value = esb.recipes.missingQuery('my_field');
t.is(value.constructor.name, 'BoolQuery');
const expected = {
@@ -16,11 +16,11 @@ test('missing query recipe', t => {
t.deepEqual(value.toJSON(), expected);
});
-test(illegalParamType, bob.recipes, 'randomSortQuery', 'Query');
+test(illegalParamType, esb.recipes, 'randomSortQuery', 'Query');
test('random sort query', t => {
- t.is(bob.recipes.randomSortQuery, bob.cookRandomSortQuery);
+ t.is(esb.recipes.randomSortQuery, esb.cookRandomSortQuery);
- let value = bob.recipes.randomSortQuery();
+ let value = esb.recipes.randomSortQuery();
t.is(value.constructor.name, 'FunctionScoreQuery');
let expected = {
@@ -34,8 +34,8 @@ test('random sort query', t => {
t.deepEqual(value.toJSON(), expected);
const seed = Date.now();
- value = bob.recipes
- .randomSortQuery(new bob.RangeQuery('age').gte(10), seed)
+ value = esb.recipes
+ .randomSortQuery(new esb.RangeQuery('age').gte(10), seed)
.toJSON();
expected = {
function_score: {
@@ -48,12 +48,12 @@ test('random sort query', t => {
t.deepEqual(value, expected);
});
-test(illegalParamType, bob.recipes, 'filterQuery', 'Query');
+test(illegalParamType, esb.recipes, 'filterQuery', 'Query');
test('filter query', t => {
- t.is(bob.recipes.filterQuery, bob.cookFilterQuery);
+ t.is(esb.recipes.filterQuery, esb.cookFilterQuery);
- const qry = new bob.TermQuery('status', 'active');
- let value = bob.recipes.filterQuery(qry);
+ const qry = new esb.TermQuery('status', 'active');
+ let value = esb.recipes.filterQuery(qry);
t.is(value.constructor.name, 'BoolQuery');
let expected = {
@@ -65,7 +65,7 @@ test('filter query', t => {
};
t.deepEqual(value.toJSON(), expected);
- value = bob.recipes.filterQuery(qry, true).toJSON();
+ value = esb.recipes.filterQuery(qry, true).toJSON();
expected = {
bool: {
must: { match_all: {} },
diff --git a/test/typedef.test.ts b/test/typedef.test.ts
index 68c4fddb..4db00b60 100644
--- a/test/typedef.test.ts
+++ b/test/typedef.test.ts
@@ -1,21 +1,21 @@
-import * as bob from '../';
+import * as esb from '../';
-new bob.RequestBodySearch().query(new bob.MatchQuery('message', 'this is a test')).toJSON();
+new esb.RequestBodySearch().query(new esb.MatchQuery('message', 'this is a test')).toJSON();
-bob
+esb
.requestBodySearch()
.query(
- bob
+ esb
.boolQuery()
- .must(bob.matchQuery('last_name', 'smith'))
- .filter(bob.rangeQuery('age').gt(30))
+ .must(esb.matchQuery('last_name', 'smith'))
+ .filter(esb.rangeQuery('age').gt(30))
);
// Multi Match Query
-bob
+esb
.requestBodySearch()
.query(
- bob
+ esb
.multiMatchQuery(['title', 'body'], 'Quick brown fox')
.type('best_fields')
.tieBreaker(0.3)
@@ -23,44 +23,44 @@ bob
);
// Aggregation
-bob.requestBodySearch().size(0).agg(bob.termsAggregation('popular_colors', 'color'));
+esb.requestBodySearch().size(0).agg(esb.termsAggregation('popular_colors', 'color'));
// Nested Aggregation
-bob
+esb
.requestBodySearch()
.size(0)
.agg(
- bob
+ esb
.termsAggregation('colors', 'color')
- .agg(bob.avgAggregation('avg_price', 'price'))
- .agg(bob.termsAggregation('make', 'make'))
+ .agg(esb.avgAggregation('avg_price', 'price'))
+ .agg(esb.termsAggregation('make', 'make'))
);
-new bob.TermsAggregation('countries', 'artist.country')
+new esb.TermsAggregation('countries', 'artist.country')
.order('rock>playback_stats.avg', 'desc')
.agg(
- new bob.FilterAggregation('rock', new bob.TermQuery('genre', 'rock')).agg(
- new bob.StatsAggregation('playback_stats', 'play_count')
+ new esb.FilterAggregation('rock', new esb.TermQuery('genre', 'rock')).agg(
+ new esb.StatsAggregation('playback_stats', 'play_count')
)
)
.toJSON();
// Sort
-bob
+esb
.requestBodySearch()
- .query(bob.boolQuery().filter(bob.termQuery('message', 'test')))
- .sort(bob.sort('timestamp', 'desc'))
+ .query(esb.boolQuery().filter(esb.termQuery('message', 'test')))
+ .sort(esb.sort('timestamp', 'desc'))
.sorts([
- bob.sort('channel', 'desc'),
- bob.sort('categories', 'desc'),
+ esb.sort('channel', 'desc'),
+ esb.sort('categories', 'desc'),
// The order defaults to desc when sorting on the _score,
// and defaults to asc when sorting on anything else.
- bob.sort('content'),
- bob.sort('price').order('desc').mode('avg')
+ esb.sort('content'),
+ esb.sort('price').order('desc').mode('avg')
]);
// From / size
-bob.requestBodySearch().query(bob.matchAllQuery()).size(5).from(10);
+esb.requestBodySearch().query(esb.matchAllQuery()).size(5).from(10);
-bob.recipes.filterQuery(bob.matchQuery('message', 'this is a test'))
+esb.recipes.filterQuery(esb.matchQuery('message', 'this is a test'))
diff --git a/webpack.config.js b/webpack.config.js
index 2365e0db..89cb7ea0 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -4,7 +4,7 @@ const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
module.exports = {
output: {
- library: 'bob',
+ library: 'esb',
libraryTarget: 'umd'
},
plugins: [