From 803739b4cb8bee40343803632eb04edf9d556207 Mon Sep 17 00:00:00 2001 From: Tomas Della Vedova Date: Fri, 15 May 2020 10:34:39 +0200 Subject: [PATCH] Added new docs examples (#1189) --- .../04f5dd677c777bcb15d7d5fa63275fc8.asciidoc | 12 ++++ .../0bd3923424a20a4ba860b0774b9991b1.asciidoc | 39 +++++++++++++ .../0be2c28ee65384774b1e479b47dc3d92.asciidoc | 16 ++++++ .../1aa91d3d48140d6367b6cabca8737b8f.asciidoc | 43 ++++++++++++++ .../1b542e3ea87a742f95641d64dcfb1bdb.asciidoc | 12 ++++ .../23ab0f1023b1b2cd5cdf2a8f9ccfd57b.asciidoc | 20 +++++++ .../3653567181f43a5f64c74f934aa821c2.asciidoc | 20 +++++++ .../42744a175125df5be0ef77413bf8f608.asciidoc | 16 ++++++ .../427f6b5c5376cbf0f71f242a60ca3d9e.asciidoc | 13 +++++ .../46c4b0dfb674825f9579203d41e7f404.asciidoc | 20 +++++++ .../4d6997c70a1851f9151443c0d38b532e.asciidoc | 55 ++++++++++++++++++ .../54092c8c646133f5dbbc047990dd458d.asciidoc | 36 ++++++++++++ .../5f210f74725ea0c9265190346edfa246.asciidoc | 23 ++++++++ .../618d5f3d35921d8cb7e9ccfbe9a4c3e3.asciidoc | 22 +++++++ .../645136747d37368a14ab34de8bd046c6.asciidoc | 57 +++++++++++++++++++ .../645c4c6e209719d3a4d25b1a629cb23b.asciidoc | 20 +++++++ .../6799d132c1c7ca3970763acde2337ef9.asciidoc | 20 +++++++ .../67bba546d835bca8f31df13e3587c348.asciidoc | 12 ++++ .../6a81d00f0d73bc5985e76b3cadab645e.asciidoc | 26 +++++++++ .../6be70810d6ebd6f09d8a49f9df847765.asciidoc | 37 ++++++++++++ .../7cf71671859be7c1ecf673396db377cd.asciidoc | 25 ++++++++ .../8653e76676de5d327201b77512afa3a0.asciidoc | 16 ++++++ .../873fbbc6ab81409058591385fd602736.asciidoc | 49 ++++++++++++++++ .../8eaf4d5dd4ab1335deefa7749fdbbcc3.asciidoc | 22 +++++++ .../8f0511f8a5cb176ff2afdd4311799a33.asciidoc | 34 +++++++++++ ...9a26759ccbd338224ecaacf7c49ab08e.asciidoc} | 11 ++-- .../a42f33e15b0995bb4b6058659bfdea85.asciidoc | 22 +++++++ .../a7c15fe6b5779c84ce9a34bf4b2a7ab7.asciidoc | 19 +++++++ .../ad79228630684d950fe9792a768d24c5.asciidoc | 28 +++++++++ .../af3fb9fa5691a7b37a6dc2a69ff66e64.asciidoc | 26 +++++++++ .../b02e4907c9936c1adc16ccce9d49900d.asciidoc | 9 +++ .../b0ec418bf416c62bed602b0a32a6d5f5.asciidoc | 15 +++++ .../b4392116f2cc57ce8064ccbad30318d5.asciidoc | 20 +++++++ .../b4a0d0ed512dffc10ee53bca2feca49b.asciidoc | 43 ++++++++++++++ .../b68c85fe1b0d2f264dc0d1cbf530f319.asciidoc | 30 ++++++++++ .../ba0b4081c98f3387f76b77847c52ee9a.asciidoc | 31 ++++++++++ .../bc1ad5cc6d3eab98e3ce01f209ba7094.asciidoc | 21 +++++++ .../bfdad8a928ea30d7cf60d0a0a6bc6e2e.asciidoc | 46 +++++++++++++++ .../c48264ec5d9b9679fddd72e5c44425b9.asciidoc | 12 ++++ .../c612d93e7f682a0d731e385edf9f5d56.asciidoc | 20 +++++++ ...d2153f3100bf12c2de98f14eb86ab061.asciidoc} | 3 +- .../d3016e4e8025362ad9a05ee86bb2061f.asciidoc | 20 +++++++ .../de176bc4788ea286fff9e92418a43ea8.asciidoc | 35 ++++++++++++ .../df17f920b0deab3529b98df88b781f55.asciidoc | 40 +++++++++++++ .../dfac8d098b50aa0181161bcd17b38ef4.asciidoc | 16 ++++++ .../e2a042c629429855c3bcaefffb26b7fa.asciidoc | 21 +++++++ .../ec27afee074001b0e4e393611010842b.asciidoc | 24 ++++++++ .../ec473de07fe89bcbac1f8e278617fe46.asciidoc | 26 +++++++++ .../ef9111c1648d7820925f12e07d1346c5.asciidoc | 25 ++++++++ .../f0e21e03a07c8fa0209b0aafdb3791e6.asciidoc | 26 +++++++++ .../f6d6889667f56b8f49d2858070571a6b.asciidoc | 27 +++++++++ .../fa0f4485cd48f986b7ae8cbb24e331c4.asciidoc | 22 +++++++ .../fe5763d32955e8b65eb3048e97b1580c.asciidoc | 12 ++++ scripts/generate-docs-examples.js | 15 ++++- 54 files changed, 1321 insertions(+), 9 deletions(-) create mode 100644 docs/doc_examples/04f5dd677c777bcb15d7d5fa63275fc8.asciidoc create mode 100644 docs/doc_examples/0bd3923424a20a4ba860b0774b9991b1.asciidoc create mode 100644 docs/doc_examples/0be2c28ee65384774b1e479b47dc3d92.asciidoc create mode 100644 docs/doc_examples/1aa91d3d48140d6367b6cabca8737b8f.asciidoc create mode 100644 docs/doc_examples/1b542e3ea87a742f95641d64dcfb1bdb.asciidoc create mode 100644 docs/doc_examples/23ab0f1023b1b2cd5cdf2a8f9ccfd57b.asciidoc create mode 100644 docs/doc_examples/3653567181f43a5f64c74f934aa821c2.asciidoc create mode 100644 docs/doc_examples/42744a175125df5be0ef77413bf8f608.asciidoc create mode 100644 docs/doc_examples/427f6b5c5376cbf0f71f242a60ca3d9e.asciidoc create mode 100644 docs/doc_examples/46c4b0dfb674825f9579203d41e7f404.asciidoc create mode 100644 docs/doc_examples/4d6997c70a1851f9151443c0d38b532e.asciidoc create mode 100644 docs/doc_examples/54092c8c646133f5dbbc047990dd458d.asciidoc create mode 100644 docs/doc_examples/5f210f74725ea0c9265190346edfa246.asciidoc create mode 100644 docs/doc_examples/618d5f3d35921d8cb7e9ccfbe9a4c3e3.asciidoc create mode 100644 docs/doc_examples/645136747d37368a14ab34de8bd046c6.asciidoc create mode 100644 docs/doc_examples/645c4c6e209719d3a4d25b1a629cb23b.asciidoc create mode 100644 docs/doc_examples/6799d132c1c7ca3970763acde2337ef9.asciidoc create mode 100644 docs/doc_examples/67bba546d835bca8f31df13e3587c348.asciidoc create mode 100644 docs/doc_examples/6a81d00f0d73bc5985e76b3cadab645e.asciidoc create mode 100644 docs/doc_examples/6be70810d6ebd6f09d8a49f9df847765.asciidoc create mode 100644 docs/doc_examples/7cf71671859be7c1ecf673396db377cd.asciidoc create mode 100644 docs/doc_examples/8653e76676de5d327201b77512afa3a0.asciidoc create mode 100644 docs/doc_examples/873fbbc6ab81409058591385fd602736.asciidoc create mode 100644 docs/doc_examples/8eaf4d5dd4ab1335deefa7749fdbbcc3.asciidoc create mode 100644 docs/doc_examples/8f0511f8a5cb176ff2afdd4311799a33.asciidoc rename docs/doc_examples/{d50a3835bf5795ac73e58906a3413544.asciidoc => 9a26759ccbd338224ecaacf7c49ab08e.asciidoc} (69%) create mode 100644 docs/doc_examples/a42f33e15b0995bb4b6058659bfdea85.asciidoc create mode 100644 docs/doc_examples/a7c15fe6b5779c84ce9a34bf4b2a7ab7.asciidoc create mode 100644 docs/doc_examples/ad79228630684d950fe9792a768d24c5.asciidoc create mode 100644 docs/doc_examples/af3fb9fa5691a7b37a6dc2a69ff66e64.asciidoc create mode 100644 docs/doc_examples/b02e4907c9936c1adc16ccce9d49900d.asciidoc create mode 100644 docs/doc_examples/b0ec418bf416c62bed602b0a32a6d5f5.asciidoc create mode 100644 docs/doc_examples/b4392116f2cc57ce8064ccbad30318d5.asciidoc create mode 100644 docs/doc_examples/b4a0d0ed512dffc10ee53bca2feca49b.asciidoc create mode 100644 docs/doc_examples/b68c85fe1b0d2f264dc0d1cbf530f319.asciidoc create mode 100644 docs/doc_examples/ba0b4081c98f3387f76b77847c52ee9a.asciidoc create mode 100644 docs/doc_examples/bc1ad5cc6d3eab98e3ce01f209ba7094.asciidoc create mode 100644 docs/doc_examples/bfdad8a928ea30d7cf60d0a0a6bc6e2e.asciidoc create mode 100644 docs/doc_examples/c48264ec5d9b9679fddd72e5c44425b9.asciidoc create mode 100644 docs/doc_examples/c612d93e7f682a0d731e385edf9f5d56.asciidoc rename docs/doc_examples/{9bdd3c0d47e60c8cfafc8109f9369922.asciidoc => d2153f3100bf12c2de98f14eb86ab061.asciidoc} (85%) create mode 100644 docs/doc_examples/d3016e4e8025362ad9a05ee86bb2061f.asciidoc create mode 100644 docs/doc_examples/de176bc4788ea286fff9e92418a43ea8.asciidoc create mode 100644 docs/doc_examples/df17f920b0deab3529b98df88b781f55.asciidoc create mode 100644 docs/doc_examples/dfac8d098b50aa0181161bcd17b38ef4.asciidoc create mode 100644 docs/doc_examples/e2a042c629429855c3bcaefffb26b7fa.asciidoc create mode 100644 docs/doc_examples/ec27afee074001b0e4e393611010842b.asciidoc create mode 100644 docs/doc_examples/ec473de07fe89bcbac1f8e278617fe46.asciidoc create mode 100644 docs/doc_examples/ef9111c1648d7820925f12e07d1346c5.asciidoc create mode 100644 docs/doc_examples/f0e21e03a07c8fa0209b0aafdb3791e6.asciidoc create mode 100644 docs/doc_examples/f6d6889667f56b8f49d2858070571a6b.asciidoc create mode 100644 docs/doc_examples/fa0f4485cd48f986b7ae8cbb24e331c4.asciidoc create mode 100644 docs/doc_examples/fe5763d32955e8b65eb3048e97b1580c.asciidoc diff --git a/docs/doc_examples/04f5dd677c777bcb15d7d5fa63275fc8.asciidoc b/docs/doc_examples/04f5dd677c777bcb15d7d5fa63275fc8.asciidoc new file mode 100644 index 000000000..d7a06bce5 --- /dev/null +++ b/docs/doc_examples/04f5dd677c777bcb15d7d5fa63275fc8.asciidoc @@ -0,0 +1,12 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.cluster.health({ + wait_for_status: 'yellow', + timeout: '50s' +}) +console.log(response) +---- + diff --git a/docs/doc_examples/0bd3923424a20a4ba860b0774b9991b1.asciidoc b/docs/doc_examples/0bd3923424a20a4ba860b0774b9991b1.asciidoc new file mode 100644 index 000000000..55e11a522 --- /dev/null +++ b/docs/doc_examples/0bd3923424a20a4ba860b0774b9991b1.asciidoc @@ -0,0 +1,39 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.search({ + index: 'drivers', + body: { + query: { + nested: { + path: 'driver', + query: { + nested: { + path: 'driver.vehicle', + query: { + bool: { + must: [ + { + match: { + 'driver.vehicle.make': 'Powell Motors' + } + }, + { + match: { + 'driver.vehicle.model': 'Canyonero' + } + } + ] + } + } + } + } + } + } + } +}) +console.log(response) +---- + diff --git a/docs/doc_examples/0be2c28ee65384774b1e479b47dc3d92.asciidoc b/docs/doc_examples/0be2c28ee65384774b1e479b47dc3d92.asciidoc new file mode 100644 index 000000000..4a8775f7e --- /dev/null +++ b/docs/doc_examples/0be2c28ee65384774b1e479b47dc3d92.asciidoc @@ -0,0 +1,16 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.indices.putSettings({ + index: 'twitter', + body: { + index: { + refresh_interval: '1s' + } + } +}) +console.log(response) +---- + diff --git a/docs/doc_examples/1aa91d3d48140d6367b6cabca8737b8f.asciidoc b/docs/doc_examples/1aa91d3d48140d6367b6cabca8737b8f.asciidoc new file mode 100644 index 000000000..8881b660d --- /dev/null +++ b/docs/doc_examples/1aa91d3d48140d6367b6cabca8737b8f.asciidoc @@ -0,0 +1,43 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.bulk({ + body: [ + { + update: { + _id: '5', + _index: 'index1' + } + }, + { + doc: { + my_field: 'foo' + } + }, + { + update: { + _id: '6', + _index: 'index1' + } + }, + { + doc: { + my_field: 'foo' + } + }, + { + create: { + _id: '7', + _index: 'index1' + } + }, + { + my_field: 'foo' + } + ] +}) +console.log(response) +---- + diff --git a/docs/doc_examples/1b542e3ea87a742f95641d64dcfb1bdb.asciidoc b/docs/doc_examples/1b542e3ea87a742f95641d64dcfb1bdb.asciidoc new file mode 100644 index 000000000..29dddce33 --- /dev/null +++ b/docs/doc_examples/1b542e3ea87a742f95641d64dcfb1bdb.asciidoc @@ -0,0 +1,12 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.count({ + index: 'twitter', + q: 'user:kimchy' +}) +console.log(response) +---- + diff --git a/docs/doc_examples/23ab0f1023b1b2cd5cdf2a8f9ccfd57b.asciidoc b/docs/doc_examples/23ab0f1023b1b2cd5cdf2a8f9ccfd57b.asciidoc new file mode 100644 index 000000000..439bf360b --- /dev/null +++ b/docs/doc_examples/23ab0f1023b1b2cd5cdf2a8f9ccfd57b.asciidoc @@ -0,0 +1,20 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.indices.create({ + index: 'test1', + body: { + mappings: { + properties: { + user: { + type: 'keyword' + } + } + } + } +}) +console.log(response) +---- + diff --git a/docs/doc_examples/3653567181f43a5f64c74f934aa821c2.asciidoc b/docs/doc_examples/3653567181f43a5f64c74f934aa821c2.asciidoc new file mode 100644 index 000000000..cba7c881c --- /dev/null +++ b/docs/doc_examples/3653567181f43a5f64c74f934aa821c2.asciidoc @@ -0,0 +1,20 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.indices.updateAliases({ + body: { + actions: [ + { + remove: { + index: 'test1', + alias: 'alias1' + } + } + ] + } +}) +console.log(response) +---- + diff --git a/docs/doc_examples/42744a175125df5be0ef77413bf8f608.asciidoc b/docs/doc_examples/42744a175125df5be0ef77413bf8f608.asciidoc new file mode 100644 index 000000000..6fc780ecc --- /dev/null +++ b/docs/doc_examples/42744a175125df5be0ef77413bf8f608.asciidoc @@ -0,0 +1,16 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.indices.putSettings({ + index: 'twitter', + body: { + index: { + refresh_interval: null + } + } +}) +console.log(response) +---- + diff --git a/docs/doc_examples/427f6b5c5376cbf0f71f242a60ca3d9e.asciidoc b/docs/doc_examples/427f6b5c5376cbf0f71f242a60ca3d9e.asciidoc new file mode 100644 index 000000000..a95439de4 --- /dev/null +++ b/docs/doc_examples/427f6b5c5376cbf0f71f242a60ca3d9e.asciidoc @@ -0,0 +1,13 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.search({ + index: 'alias2', + q: 'user:kimchy', + routing: '2,3' +}) +console.log(response) +---- + diff --git a/docs/doc_examples/46c4b0dfb674825f9579203d41e7f404.asciidoc b/docs/doc_examples/46c4b0dfb674825f9579203d41e7f404.asciidoc new file mode 100644 index 000000000..af100b302 --- /dev/null +++ b/docs/doc_examples/46c4b0dfb674825f9579203d41e7f404.asciidoc @@ -0,0 +1,20 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.indices.create({ + index: 'my_index', + body: { + mappings: { + properties: { + tags: { + type: 'keyword' + } + } + } + } +}) +console.log(response) +---- + diff --git a/docs/doc_examples/4d6997c70a1851f9151443c0d38b532e.asciidoc b/docs/doc_examples/4d6997c70a1851f9151443c0d38b532e.asciidoc new file mode 100644 index 000000000..e14cc77bd --- /dev/null +++ b/docs/doc_examples/4d6997c70a1851f9151443c0d38b532e.asciidoc @@ -0,0 +1,55 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response0 = await client.index({ + index: 'my_index', + id: '1', + body: { + message: 'some arrays in this document...', + tags: [ + 'elasticsearch', + 'wow' + ], + lists: [ + { + name: 'prog_list', + description: 'programming list' + }, + { + name: 'cool_list', + description: 'cool stuff list' + } + ] + } +}) +console.log(response0) + +const response1 = await client.index({ + index: 'my_index', + id: '2', + body: { + message: 'no arrays in this document...', + tags: 'elasticsearch', + lists: { + name: 'prog_list', + description: 'programming list' + } + } +}) +console.log(response1) + +const response2 = await client.search({ + index: 'my_index', + body: { + query: { + match: { + tags: 'elasticsearch' + } + } + } +}) +console.log(response2) +---- + diff --git a/docs/doc_examples/54092c8c646133f5dbbc047990dd458d.asciidoc b/docs/doc_examples/54092c8c646133f5dbbc047990dd458d.asciidoc new file mode 100644 index 000000000..420836eac --- /dev/null +++ b/docs/doc_examples/54092c8c646133f5dbbc047990dd458d.asciidoc @@ -0,0 +1,36 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.indices.create({ + index: 'drivers', + body: { + mappings: { + properties: { + driver: { + type: 'nested', + properties: { + last_name: { + type: 'text' + }, + vehicle: { + type: 'nested', + properties: { + make: { + type: 'text' + }, + model: { + type: 'text' + } + } + } + } + } + } + } + } +}) +console.log(response) +---- + diff --git a/docs/doc_examples/5f210f74725ea0c9265190346edfa246.asciidoc b/docs/doc_examples/5f210f74725ea0c9265190346edfa246.asciidoc new file mode 100644 index 000000000..9f05c2947 --- /dev/null +++ b/docs/doc_examples/5f210f74725ea0c9265190346edfa246.asciidoc @@ -0,0 +1,23 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.indices.updateAliases({ + body: { + actions: [ + { + add: { + indices: [ + 'test1', + 'test2' + ], + alias: 'alias1' + } + } + ] + } +}) +console.log(response) +---- + diff --git a/docs/doc_examples/618d5f3d35921d8cb7e9ccfbe9a4c3e3.asciidoc b/docs/doc_examples/618d5f3d35921d8cb7e9ccfbe9a4c3e3.asciidoc new file mode 100644 index 000000000..988069e6d --- /dev/null +++ b/docs/doc_examples/618d5f3d35921d8cb7e9ccfbe9a4c3e3.asciidoc @@ -0,0 +1,22 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.search({ + body: { + query: { + regexp: { + user: { + value: 'k.*y', + flags: 'ALL', + max_determinized_states: 10000, + rewrite: 'constant_score' + } + } + } + } +}) +console.log(response) +---- + diff --git a/docs/doc_examples/645136747d37368a14ab34de8bd046c6.asciidoc b/docs/doc_examples/645136747d37368a14ab34de8bd046c6.asciidoc new file mode 100644 index 000000000..ef507a7b1 --- /dev/null +++ b/docs/doc_examples/645136747d37368a14ab34de8bd046c6.asciidoc @@ -0,0 +1,57 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response0 = await client.indices.create({ + index: 'my_index', + body: { + mappings: { + properties: { + date: { + type: 'date' + } + } + } + } +}) +console.log(response0) + +const response1 = await client.index({ + index: 'my_index', + id: '1', + body: { + date: '2015-01-01' + } +}) +console.log(response1) + +const response2 = await client.index({ + index: 'my_index', + id: '2', + body: { + date: '2015-01-01T12:10:30Z' + } +}) +console.log(response2) + +const response3 = await client.index({ + index: 'my_index', + id: '3', + body: { + date: 1420070400001 + } +}) +console.log(response3) + +const response4 = await client.search({ + index: 'my_index', + body: { + sort: { + date: 'asc' + } + } +}) +console.log(response4) +---- + diff --git a/docs/doc_examples/645c4c6e209719d3a4d25b1a629cb23b.asciidoc b/docs/doc_examples/645c4c6e209719d3a4d25b1a629cb23b.asciidoc new file mode 100644 index 000000000..89ed665b3 --- /dev/null +++ b/docs/doc_examples/645c4c6e209719d3a4d25b1a629cb23b.asciidoc @@ -0,0 +1,20 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.search({ + body: { + query: { + function_score: { + random_score: { + seed: 10, + field: '_seq_no' + } + } + } + } +}) +console.log(response) +---- + diff --git a/docs/doc_examples/6799d132c1c7ca3970763acde2337ef9.asciidoc b/docs/doc_examples/6799d132c1c7ca3970763acde2337ef9.asciidoc new file mode 100644 index 000000000..e22d0dadc --- /dev/null +++ b/docs/doc_examples/6799d132c1c7ca3970763acde2337ef9.asciidoc @@ -0,0 +1,20 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.indices.updateAliases({ + body: { + actions: [ + { + add: { + index: 'test*', + alias: 'all_test_indices' + } + } + ] + } +}) +console.log(response) +---- + diff --git a/docs/doc_examples/67bba546d835bca8f31df13e3587c348.asciidoc b/docs/doc_examples/67bba546d835bca8f31df13e3587c348.asciidoc new file mode 100644 index 000000000..9e6ddc036 --- /dev/null +++ b/docs/doc_examples/67bba546d835bca8f31df13e3587c348.asciidoc @@ -0,0 +1,12 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.get({ + index: 'test', + id: '1' +}) +console.log(response) +---- + diff --git a/docs/doc_examples/6a81d00f0d73bc5985e76b3cadab645e.asciidoc b/docs/doc_examples/6a81d00f0d73bc5985e76b3cadab645e.asciidoc new file mode 100644 index 000000000..9a500641a --- /dev/null +++ b/docs/doc_examples/6a81d00f0d73bc5985e76b3cadab645e.asciidoc @@ -0,0 +1,26 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.indices.create({ + index: 'my_index', + body: { + mappings: { + properties: { + tag: { + type: 'text', + fielddata: true, + fielddata_frequency_filter: { + min: 0.001, + max: 0.1, + min_segment_size: 500 + } + } + } + } + } +}) +console.log(response) +---- + diff --git a/docs/doc_examples/6be70810d6ebd6f09d8a49f9df847765.asciidoc b/docs/doc_examples/6be70810d6ebd6f09d8a49f9df847765.asciidoc new file mode 100644 index 000000000..66307ee3c --- /dev/null +++ b/docs/doc_examples/6be70810d6ebd6f09d8a49f9df847765.asciidoc @@ -0,0 +1,37 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.search({ + index: 'my_index', + body: { + query: { + nested: { + path: 'obj1', + query: { + bool: { + must: [ + { + match: { + 'obj1.name': 'blue' + } + }, + { + range: { + 'obj1.count': { + gt: 5 + } + } + } + ] + } + }, + score_mode: 'avg' + } + } + } +}) +console.log(response) +---- + diff --git a/docs/doc_examples/7cf71671859be7c1ecf673396db377cd.asciidoc b/docs/doc_examples/7cf71671859be7c1ecf673396db377cd.asciidoc new file mode 100644 index 000000000..1b52d5faa --- /dev/null +++ b/docs/doc_examples/7cf71671859be7c1ecf673396db377cd.asciidoc @@ -0,0 +1,25 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.indices.updateAliases({ + body: { + actions: [ + { + add: { + index: 'test1', + alias: 'alias2', + filter: { + term: { + user: 'kimchy' + } + } + } + } + ] + } +}) +console.log(response) +---- + diff --git a/docs/doc_examples/8653e76676de5d327201b77512afa3a0.asciidoc b/docs/doc_examples/8653e76676de5d327201b77512afa3a0.asciidoc new file mode 100644 index 000000000..5ef368ade --- /dev/null +++ b/docs/doc_examples/8653e76676de5d327201b77512afa3a0.asciidoc @@ -0,0 +1,16 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.indices.putSettings({ + index: 'twitter', + body: { + index: { + number_of_replicas: 2 + } + } +}) +console.log(response) +---- + diff --git a/docs/doc_examples/873fbbc6ab81409058591385fd602736.asciidoc b/docs/doc_examples/873fbbc6ab81409058591385fd602736.asciidoc new file mode 100644 index 000000000..6722b4fb3 --- /dev/null +++ b/docs/doc_examples/873fbbc6ab81409058591385fd602736.asciidoc @@ -0,0 +1,49 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response0 = await client.index({ + index: 'drivers', + id: '1', + body: { + driver: { + last_name: 'McQueen', + vehicle: [ + { + make: 'Powell Motors', + model: 'Canyonero' + }, + { + make: 'Miller-Meteor', + model: 'Ecto-1' + } + ] + } + } +}) +console.log(response0) + +const response1 = await client.index({ + index: 'drivers', + id: '2', + refresh: true, + body: { + driver: { + last_name: 'Hudson', + vehicle: [ + { + make: 'Mifune', + model: 'Mach Five' + }, + { + make: 'Miller-Meteor', + model: 'Ecto-1' + } + ] + } + } +}) +console.log(response1) +---- + diff --git a/docs/doc_examples/8eaf4d5dd4ab1335deefa7749fdbbcc3.asciidoc b/docs/doc_examples/8eaf4d5dd4ab1335deefa7749fdbbcc3.asciidoc new file mode 100644 index 000000000..54bc01d70 --- /dev/null +++ b/docs/doc_examples/8eaf4d5dd4ab1335deefa7749fdbbcc3.asciidoc @@ -0,0 +1,22 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.search({ + body: { + query: { + function_score: { + field_value_factor: { + field: 'likes', + factor: 1.2, + modifier: 'sqrt', + missing: 1 + } + } + } + } +}) +console.log(response) +---- + diff --git a/docs/doc_examples/8f0511f8a5cb176ff2afdd4311799a33.asciidoc b/docs/doc_examples/8f0511f8a5cb176ff2afdd4311799a33.asciidoc new file mode 100644 index 000000000..15040fe9b --- /dev/null +++ b/docs/doc_examples/8f0511f8a5cb176ff2afdd4311799a33.asciidoc @@ -0,0 +1,34 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response0 = await client.index({ + index: 'twitter', + id: '1', + refresh: true, + body: { + user: 'kimchy' + } +}) +console.log(response0) + +const response1 = await client.count({ + index: 'twitter', + q: 'user:kimchy' +}) +console.log(response1) + +const response2 = await client.count({ + index: 'twitter', + body: { + query: { + term: { + user: 'kimchy' + } + } + } +}) +console.log(response2) +---- + diff --git a/docs/doc_examples/d50a3835bf5795ac73e58906a3413544.asciidoc b/docs/doc_examples/9a26759ccbd338224ecaacf7c49ab08e.asciidoc similarity index 69% rename from docs/doc_examples/d50a3835bf5795ac73e58906a3413544.asciidoc rename to docs/doc_examples/9a26759ccbd338224ecaacf7c49ab08e.asciidoc index a85a3d176..f143ebc34 100644 --- a/docs/doc_examples/d50a3835bf5795ac73e58906a3413544.asciidoc +++ b/docs/doc_examples/9a26759ccbd338224ecaacf7c49ab08e.asciidoc @@ -5,12 +5,11 @@ ---- const response = await client.search({ body: { - aggs: { - products: { - terms: { - field: 'product', - size: 5 - } + from: 0, + size: 10, + query: { + term: { + user: 'kimchy' } } } diff --git a/docs/doc_examples/a42f33e15b0995bb4b6058659bfdea85.asciidoc b/docs/doc_examples/a42f33e15b0995bb4b6058659bfdea85.asciidoc new file mode 100644 index 000000000..34bd3c81a --- /dev/null +++ b/docs/doc_examples/a42f33e15b0995bb4b6058659bfdea85.asciidoc @@ -0,0 +1,22 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.search({ + body: { + query: { + function_score: { + query: { + match_all: {} + }, + boost: '5', + random_score: {}, + boost_mode: 'multiply' + } + } + } +}) +console.log(response) +---- + diff --git a/docs/doc_examples/a7c15fe6b5779c84ce9a34bf4b2a7ab7.asciidoc b/docs/doc_examples/a7c15fe6b5779c84ce9a34bf4b2a7ab7.asciidoc new file mode 100644 index 000000000..fb7990dd8 --- /dev/null +++ b/docs/doc_examples/a7c15fe6b5779c84ce9a34bf4b2a7ab7.asciidoc @@ -0,0 +1,19 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.indices.putMapping({ + index: 'my_index', + body: { + properties: { + my_field: { + type: 'text', + fielddata: true + } + } + } +}) +console.log(response) +---- + diff --git a/docs/doc_examples/ad79228630684d950fe9792a768d24c5.asciidoc b/docs/doc_examples/ad79228630684d950fe9792a768d24c5.asciidoc new file mode 100644 index 000000000..7911e5d56 --- /dev/null +++ b/docs/doc_examples/ad79228630684d950fe9792a768d24c5.asciidoc @@ -0,0 +1,28 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.indices.updateAliases({ + body: { + actions: [ + { + add: { + index: 'test', + alias: 'alias1', + is_write_index: false + } + }, + { + add: { + index: 'test2', + alias: 'alias1', + is_write_index: true + } + } + ] + } +}) +console.log(response) +---- + diff --git a/docs/doc_examples/af3fb9fa5691a7b37a6dc2a69ff66e64.asciidoc b/docs/doc_examples/af3fb9fa5691a7b37a6dc2a69ff66e64.asciidoc new file mode 100644 index 000000000..e35a78b95 --- /dev/null +++ b/docs/doc_examples/af3fb9fa5691a7b37a6dc2a69ff66e64.asciidoc @@ -0,0 +1,26 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.indices.updateAliases({ + body: { + actions: [ + { + remove: { + index: 'test1', + alias: 'alias1' + } + }, + { + add: { + index: 'test1', + alias: 'alias2' + } + } + ] + } +}) +console.log(response) +---- + diff --git a/docs/doc_examples/b02e4907c9936c1adc16ccce9d49900d.asciidoc b/docs/doc_examples/b02e4907c9936c1adc16ccce9d49900d.asciidoc new file mode 100644 index 000000000..f3eb9c277 --- /dev/null +++ b/docs/doc_examples/b02e4907c9936c1adc16ccce9d49900d.asciidoc @@ -0,0 +1,9 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.cluster.health() +console.log(response) +---- + diff --git a/docs/doc_examples/b0ec418bf416c62bed602b0a32a6d5f5.asciidoc b/docs/doc_examples/b0ec418bf416c62bed602b0a32a6d5f5.asciidoc new file mode 100644 index 000000000..61ba1d017 --- /dev/null +++ b/docs/doc_examples/b0ec418bf416c62bed602b0a32a6d5f5.asciidoc @@ -0,0 +1,15 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.index({ + index: 'alias1', + id: '1', + body: { + foo: 'bar' + } +}) +console.log(response) +---- + diff --git a/docs/doc_examples/b4392116f2cc57ce8064ccbad30318d5.asciidoc b/docs/doc_examples/b4392116f2cc57ce8064ccbad30318d5.asciidoc new file mode 100644 index 000000000..f4b8f3ffc --- /dev/null +++ b/docs/doc_examples/b4392116f2cc57ce8064ccbad30318d5.asciidoc @@ -0,0 +1,20 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.indices.updateAliases({ + body: { + actions: [ + { + add: { + index: 'test1', + alias: 'alias1' + } + } + ] + } +}) +console.log(response) +---- + diff --git a/docs/doc_examples/b4a0d0ed512dffc10ee53bca2feca49b.asciidoc b/docs/doc_examples/b4a0d0ed512dffc10ee53bca2feca49b.asciidoc new file mode 100644 index 000000000..86335844e --- /dev/null +++ b/docs/doc_examples/b4a0d0ed512dffc10ee53bca2feca49b.asciidoc @@ -0,0 +1,43 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.search({ + body: { + query: { + function_score: { + query: { + match_all: {} + }, + boost: '5', + functions: [ + { + filter: { + match: { + test: 'bar' + } + }, + random_score: {}, + weight: 23 + }, + { + filter: { + match: { + test: 'cat' + } + }, + weight: 42 + } + ], + max_boost: 42, + score_mode: 'max', + boost_mode: 'multiply', + min_score: 42 + } + } + } +}) +console.log(response) +---- + diff --git a/docs/doc_examples/b68c85fe1b0d2f264dc0d1cbf530f319.asciidoc b/docs/doc_examples/b68c85fe1b0d2f264dc0d1cbf530f319.asciidoc new file mode 100644 index 000000000..f428e4fb7 --- /dev/null +++ b/docs/doc_examples/b68c85fe1b0d2f264dc0d1cbf530f319.asciidoc @@ -0,0 +1,30 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.search({ + body: { + query: { + function_score: { + query: { + match: { + message: 'elasticsearch' + } + }, + script_score: { + script: { + params: { + a: 5, + b: 1.2 + }, + source: "params.a / Math.pow(params.b, doc['likes'].value)" + } + } + } + } + } +}) +console.log(response) +---- + diff --git a/docs/doc_examples/ba0b4081c98f3387f76b77847c52ee9a.asciidoc b/docs/doc_examples/ba0b4081c98f3387f76b77847c52ee9a.asciidoc new file mode 100644 index 000000000..b68015bb2 --- /dev/null +++ b/docs/doc_examples/ba0b4081c98f3387f76b77847c52ee9a.asciidoc @@ -0,0 +1,31 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response0 = await client.indices.close({ + index: 'twitter' +}) +console.log(response0) + +const response1 = await client.indices.putSettings({ + index: 'twitter', + body: { + analysis: { + analyzer: { + content: { + type: 'custom', + tokenizer: 'whitespace' + } + } + } + } +}) +console.log(response1) + +const response2 = await client.indices.open({ + index: 'twitter' +}) +console.log(response2) +---- + diff --git a/docs/doc_examples/bc1ad5cc6d3eab98e3ce01f209ba7094.asciidoc b/docs/doc_examples/bc1ad5cc6d3eab98e3ce01f209ba7094.asciidoc new file mode 100644 index 000000000..d44288214 --- /dev/null +++ b/docs/doc_examples/bc1ad5cc6d3eab98e3ce01f209ba7094.asciidoc @@ -0,0 +1,21 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.indices.updateAliases({ + body: { + actions: [ + { + add: { + index: 'test', + alias: 'alias1', + routing: '1' + } + } + ] + } +}) +console.log(response) +---- + diff --git a/docs/doc_examples/bfdad8a928ea30d7cf60d0a0a6bc6e2e.asciidoc b/docs/doc_examples/bfdad8a928ea30d7cf60d0a0a6bc6e2e.asciidoc new file mode 100644 index 000000000..f57620210 --- /dev/null +++ b/docs/doc_examples/bfdad8a928ea30d7cf60d0a0a6bc6e2e.asciidoc @@ -0,0 +1,46 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.bulk({ + filter_path: 'items.*.error', + body: [ + { + update: { + _id: '5', + _index: 'index1' + } + }, + { + doc: { + my_field: 'baz' + } + }, + { + update: { + _id: '6', + _index: 'index1' + } + }, + { + doc: { + my_field: 'baz' + } + }, + { + update: { + _id: '7', + _index: 'index1' + } + }, + { + doc: { + my_field: 'baz' + } + } + ] +}) +console.log(response) +---- + diff --git a/docs/doc_examples/c48264ec5d9b9679fddd72e5c44425b9.asciidoc b/docs/doc_examples/c48264ec5d9b9679fddd72e5c44425b9.asciidoc new file mode 100644 index 000000000..646050e2b --- /dev/null +++ b/docs/doc_examples/c48264ec5d9b9679fddd72e5c44425b9.asciidoc @@ -0,0 +1,12 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.cluster.health({ + index: 'twitter', + level: 'shards' +}) +console.log(response) +---- + diff --git a/docs/doc_examples/c612d93e7f682a0d731e385edf9f5d56.asciidoc b/docs/doc_examples/c612d93e7f682a0d731e385edf9f5d56.asciidoc new file mode 100644 index 000000000..7abc351c7 --- /dev/null +++ b/docs/doc_examples/c612d93e7f682a0d731e385edf9f5d56.asciidoc @@ -0,0 +1,20 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.indices.create({ + index: 'my_index', + body: { + mappings: { + properties: { + obj1: { + type: 'nested' + } + } + } + } +}) +console.log(response) +---- + diff --git a/docs/doc_examples/9bdd3c0d47e60c8cfafc8109f9369922.asciidoc b/docs/doc_examples/d2153f3100bf12c2de98f14eb86ab061.asciidoc similarity index 85% rename from docs/doc_examples/9bdd3c0d47e60c8cfafc8109f9369922.asciidoc rename to docs/doc_examples/d2153f3100bf12c2de98f14eb86ab061.asciidoc index 20f588798..8d4335ffa 100644 --- a/docs/doc_examples/9bdd3c0d47e60c8cfafc8109f9369922.asciidoc +++ b/docs/doc_examples/d2153f3100bf12c2de98f14eb86ab061.asciidoc @@ -4,8 +4,7 @@ [source, js] ---- const response = await client.search({ - index: 'twitter', - q: 'tag:wow' + index: 'twitter' }) console.log(response) ---- diff --git a/docs/doc_examples/d3016e4e8025362ad9a05ee86bb2061f.asciidoc b/docs/doc_examples/d3016e4e8025362ad9a05ee86bb2061f.asciidoc new file mode 100644 index 000000000..17fdfe181 --- /dev/null +++ b/docs/doc_examples/d3016e4e8025362ad9a05ee86bb2061f.asciidoc @@ -0,0 +1,20 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.indices.updateAliases({ + body: { + actions: [ + { + add: { + index: 'twitter', + alias: 'alias1' + } + } + ] + } +}) +console.log(response) +---- + diff --git a/docs/doc_examples/de176bc4788ea286fff9e92418a43ea8.asciidoc b/docs/doc_examples/de176bc4788ea286fff9e92418a43ea8.asciidoc new file mode 100644 index 000000000..995280ef7 --- /dev/null +++ b/docs/doc_examples/de176bc4788ea286fff9e92418a43ea8.asciidoc @@ -0,0 +1,35 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response0 = await client.indices.create({ + index: 'test' +}) +console.log(response0) + +const response1 = await client.indices.create({ + index: 'test_2' +}) +console.log(response1) + +const response2 = await client.indices.updateAliases({ + body: { + actions: [ + { + add: { + index: 'test_2', + alias: 'test' + } + }, + { + remove_index: { + index: 'test' + } + } + ] + } +}) +console.log(response2) +---- + diff --git a/docs/doc_examples/df17f920b0deab3529b98df88b781f55.asciidoc b/docs/doc_examples/df17f920b0deab3529b98df88b781f55.asciidoc new file mode 100644 index 000000000..b3e06489a --- /dev/null +++ b/docs/doc_examples/df17f920b0deab3529b98df88b781f55.asciidoc @@ -0,0 +1,40 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.search({ + body: { + query: { + function_score: { + functions: [ + { + gauss: { + price: { + origin: '0', + scale: '20' + } + } + }, + { + gauss: { + location: { + origin: '11, 12', + scale: '2km' + } + } + } + ], + query: { + match: { + properties: 'balcony' + } + }, + score_mode: 'multiply' + } + } + } +}) +console.log(response) +---- + diff --git a/docs/doc_examples/dfac8d098b50aa0181161bcd17b38ef4.asciidoc b/docs/doc_examples/dfac8d098b50aa0181161bcd17b38ef4.asciidoc new file mode 100644 index 000000000..614fea4b9 --- /dev/null +++ b/docs/doc_examples/dfac8d098b50aa0181161bcd17b38ef4.asciidoc @@ -0,0 +1,16 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.indices.putSettings({ + index: 'twitter', + body: { + index: { + refresh_interval: '-1' + } + } +}) +console.log(response) +---- + diff --git a/docs/doc_examples/e2a042c629429855c3bcaefffb26b7fa.asciidoc b/docs/doc_examples/e2a042c629429855c3bcaefffb26b7fa.asciidoc new file mode 100644 index 000000000..9021864be --- /dev/null +++ b/docs/doc_examples/e2a042c629429855c3bcaefffb26b7fa.asciidoc @@ -0,0 +1,21 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.indices.create({ + index: 'my_index', + body: { + mappings: { + properties: { + date: { + type: 'date', + format: 'yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis' + } + } + } + } +}) +console.log(response) +---- + diff --git a/docs/doc_examples/ec27afee074001b0e4e393611010842b.asciidoc b/docs/doc_examples/ec27afee074001b0e4e393611010842b.asciidoc new file mode 100644 index 000000000..8fe4fee7b --- /dev/null +++ b/docs/doc_examples/ec27afee074001b0e4e393611010842b.asciidoc @@ -0,0 +1,24 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.search({ + body: { + query: { + function_score: { + gauss: { + date: { + origin: '2013-09-17', + scale: '10d', + offset: '5d', + decay: 0.5 + } + } + } + } + } +}) +console.log(response) +---- + diff --git a/docs/doc_examples/ec473de07fe89bcbac1f8e278617fe46.asciidoc b/docs/doc_examples/ec473de07fe89bcbac1f8e278617fe46.asciidoc new file mode 100644 index 000000000..9d15fe856 --- /dev/null +++ b/docs/doc_examples/ec473de07fe89bcbac1f8e278617fe46.asciidoc @@ -0,0 +1,26 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.search({ + body: { + query: { + function_score: { + query: { + match: { + message: 'elasticsearch' + } + }, + script_score: { + script: { + source: "Math.log(2 + doc['likes'].value)" + } + } + } + } + } +}) +console.log(response) +---- + diff --git a/docs/doc_examples/ef9111c1648d7820925f12e07d1346c5.asciidoc b/docs/doc_examples/ef9111c1648d7820925f12e07d1346c5.asciidoc new file mode 100644 index 000000000..384df2da6 --- /dev/null +++ b/docs/doc_examples/ef9111c1648d7820925f12e07d1346c5.asciidoc @@ -0,0 +1,25 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.indices.create({ + index: 'my_index', + body: { + mappings: { + properties: { + my_field: { + type: 'text', + fields: { + keyword: { + type: 'keyword' + } + } + } + } + } + } +}) +console.log(response) +---- + diff --git a/docs/doc_examples/f0e21e03a07c8fa0209b0aafdb3791e6.asciidoc b/docs/doc_examples/f0e21e03a07c8fa0209b0aafdb3791e6.asciidoc new file mode 100644 index 000000000..054b26dd6 --- /dev/null +++ b/docs/doc_examples/f0e21e03a07c8fa0209b0aafdb3791e6.asciidoc @@ -0,0 +1,26 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.indices.updateAliases({ + body: { + actions: [ + { + add: { + index: 'test1', + alias: 'alias1' + } + }, + { + add: { + index: 'test2', + alias: 'alias1' + } + } + ] + } +}) +console.log(response) +---- + diff --git a/docs/doc_examples/f6d6889667f56b8f49d2858070571a6b.asciidoc b/docs/doc_examples/f6d6889667f56b8f49d2858070571a6b.asciidoc new file mode 100644 index 000000000..19ad9c0a6 --- /dev/null +++ b/docs/doc_examples/f6d6889667f56b8f49d2858070571a6b.asciidoc @@ -0,0 +1,27 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.indices.updateAliases({ + body: { + actions: [ + { + add: { + index: 'test', + alias: 'alias1', + is_write_index: true + } + }, + { + add: { + index: 'test2', + alias: 'alias1' + } + } + ] + } +}) +console.log(response) +---- + diff --git a/docs/doc_examples/fa0f4485cd48f986b7ae8cbb24e331c4.asciidoc b/docs/doc_examples/fa0f4485cd48f986b7ae8cbb24e331c4.asciidoc new file mode 100644 index 000000000..2b631649e --- /dev/null +++ b/docs/doc_examples/fa0f4485cd48f986b7ae8cbb24e331c4.asciidoc @@ -0,0 +1,22 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.indices.updateAliases({ + body: { + actions: [ + { + add: { + index: 'test', + alias: 'alias2', + search_routing: '1,2', + index_routing: '2' + } + } + ] + } +}) +console.log(response) +---- + diff --git a/docs/doc_examples/fe5763d32955e8b65eb3048e97b1580c.asciidoc b/docs/doc_examples/fe5763d32955e8b65eb3048e97b1580c.asciidoc new file mode 100644 index 000000000..aee2245fc --- /dev/null +++ b/docs/doc_examples/fe5763d32955e8b65eb3048e97b1580c.asciidoc @@ -0,0 +1,12 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.indices.forcemerge({ + index: 'twitter', + max_num_segments: '5' +}) +console.log(response) +---- + diff --git a/scripts/generate-docs-examples.js b/scripts/generate-docs-examples.js index 8e8fc222d..e14f8ccc9 100644 --- a/scripts/generate-docs-examples.js +++ b/scripts/generate-docs-examples.js @@ -61,7 +61,20 @@ const enabledFiles = [ 'mapping/types/nested.asciidoc', 'mapping/params/format.asciidoc', 'docs/delete-by-query.asciidoc', - 'search/request/sort.asciidoc' + 'search/request/sort.asciidoc', + 'query-dsl/function-score-query.asciidoc', + 'query-dsl/nested-query.asciidoc', + 'query-dsl/regexp-query.asciidoc', + 'mapping/types/array.asciidoc', + 'mapping/types/date.asciidoc', + 'mapping/types/keyword.asciidoc', + 'mapping/params/fielddata.asciidoc', + 'cluster/health.asciidoc', + 'docs/bulk.asciidoc', + 'indices/aliases.asciidoc', + 'indices/update-settings.asciidoc', + 'search/request/from-size.asciidoc', + 'search/count.asciidoc' ] function generate () {