diff --git a/docs/doc_examples/047266b0d20fdb62ebc72d51952c8f6d.asciidoc b/docs/doc_examples/047266b0d20fdb62ebc72d51952c8f6d.asciidoc new file mode 100644 index 000000000..ae2d02e7e --- /dev/null +++ b/docs/doc_examples/047266b0d20fdb62ebc72d51952c8f6d.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.search({ + body: { + query: { + multi_match: { + query: 'Will Smith', + type: 'cross_fields', + fields: [ + 'first_name', + 'last_name' + ], + operator: 'and' + } + } + } +}) +console.log(response) +---- + diff --git a/docs/doc_examples/0989cc65d8924f666ce3eb0820d2d244.asciidoc b/docs/doc_examples/0989cc65d8924f666ce3eb0820d2d244.asciidoc new file mode 100644 index 000000000..b7f079096 --- /dev/null +++ b/docs/doc_examples/0989cc65d8924f666ce3eb0820d2d244.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 response0 = await client.index({ + index: 'users', + refresh: 'wait_for', + body: { + user_id: 12345 + } +}) +console.log(response0) + +const response1 = await client.index({ + index: 'users', + refresh: 'wait_for', + body: { + user_id: 12346 + } +}) +console.log(response1) +---- + diff --git a/docs/doc_examples/0bbd30b9be3e54ff3028b9f4459634d2.asciidoc b/docs/doc_examples/0bbd30b9be3e54ff3028b9f4459634d2.asciidoc new file mode 100644 index 000000000..f531241da --- /dev/null +++ b/docs/doc_examples/0bbd30b9be3e54ff3028b9f4459634d2.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.putMapping({ + index: 'my_index', + body: { + properties: { + name: { + properties: { + last: { + type: 'text' + } + } + } + } + } +}) +console.log(response) +---- + diff --git a/docs/doc_examples/0e118857b815b62118a30c042f079db1.asciidoc b/docs/doc_examples/0e118857b815b62118a30c042f079db1.asciidoc new file mode 100644 index 000000000..45acb2f61 --- /dev/null +++ b/docs/doc_examples/0e118857b815b62118a30c042f079db1.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: { + multi_match: { + query: 'quick brown f', + type: 'phrase_prefix', + fields: [ + 'subject', + 'message' + ] + } + } + } +}) +console.log(response) +---- + diff --git a/docs/doc_examples/12433d2b637d002e8d5c9a1adce69d3b.asciidoc b/docs/doc_examples/12433d2b637d002e8d5c9a1adce69d3b.asciidoc new file mode 100644 index 000000000..b5c874cd0 --- /dev/null +++ b/docs/doc_examples/12433d2b637d002e8d5c9a1adce69d3b.asciidoc @@ -0,0 +1,11 @@ +// 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: 'publications' +}) +console.log(response) +---- + diff --git a/docs/doc_examples/168bfdde773570cfc6dd3ab3574e413b.asciidoc b/docs/doc_examples/168bfdde773570cfc6dd3ab3574e413b.asciidoc new file mode 100644 index 000000000..66af05e4f --- /dev/null +++ b/docs/doc_examples/168bfdde773570cfc6dd3ab3574e413b.asciidoc @@ -0,0 +1,11 @@ +// 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({ + q: 'user:kimchy' +}) +console.log(response) +---- + diff --git a/docs/doc_examples/179f0a3e84ff4bbac18787a018eabf89.asciidoc b/docs/doc_examples/179f0a3e84ff4bbac18787a018eabf89.asciidoc new file mode 100644 index 000000000..7229d6d0a --- /dev/null +++ b/docs/doc_examples/179f0a3e84ff4bbac18787a018eabf89.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: { + multi_match: { + query: 'Jon', + type: 'cross_fields', + analyzer: 'standard', + fields: [ + 'first', + 'last', + '*.edge' + ] + } + } + } +}) +console.log(response) +---- + diff --git a/docs/doc_examples/17de0020b228df961ad3c6b06233c948.asciidoc b/docs/doc_examples/17de0020b228df961ad3c6b06233c948.asciidoc new file mode 100644 index 000000000..b7cbc2f04 --- /dev/null +++ b/docs/doc_examples/17de0020b228df961ad3c6b06233c948.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: { + user_id: { + type: 'keyword', + ignore_above: 100 + } + } + } +}) +console.log(response) +---- + diff --git a/docs/doc_examples/1da77e114459e0b77d78a3dcc8fae429.asciidoc b/docs/doc_examples/1da77e114459e0b77d78a3dcc8fae429.asciidoc new file mode 100644 index 000000000..69394b727 --- /dev/null +++ b/docs/doc_examples/1da77e114459e0b77d78a3dcc8fae429.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 response0 = await client.indices.create({ + index: 'twitter-1' +}) +console.log(response0) + +const response1 = await client.indices.create({ + index: 'twitter-2' +}) +console.log(response1) + +const response2 = await client.indices.putMapping({ + index: 'twitter-1,twitter-2', + body: { + properties: { + user_name: { + type: 'text' + } + } + } +}) +console.log(response2) +---- + diff --git a/docs/doc_examples/1f6fe6833686e38c3711c6f2aa00a078.asciidoc b/docs/doc_examples/1f6fe6833686e38c3711c6f2aa00a078.asciidoc new file mode 100644 index 000000000..8d1852655 --- /dev/null +++ b/docs/doc_examples/1f6fe6833686e38c3711c6f2aa00a078.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: { + user_id: { + type: 'keyword', + ignore_above: 20 + } + } + } + } +}) +console.log(response) +---- + diff --git a/docs/doc_examples/210cf5c76bff517f48e80fa1c2d63907.asciidoc b/docs/doc_examples/210cf5c76bff517f48e80fa1c2d63907.asciidoc new file mode 100644 index 000000000..54576e75d --- /dev/null +++ b/docs/doc_examples/210cf5c76bff517f48e80fa1c2d63907.asciidoc @@ -0,0 +1,11 @@ +// 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.getMapping({ + index: 'my_index' +}) +console.log(response) +---- + diff --git a/docs/doc_examples/33f148e3d8676de6cc52f58749898a13.asciidoc b/docs/doc_examples/33f148e3d8676de6cc52f58749898a13.asciidoc new file mode 100644 index 000000000..35ca65dd2 --- /dev/null +++ b/docs/doc_examples/33f148e3d8676de6cc52f58749898a13.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.search({ + body: { + query: { + dis_max: { + queries: [ + { + match_phrase_prefix: { + subject: 'quick brown f' + } + }, + { + match_phrase_prefix: { + message: 'quick brown f' + } + } + ] + } + } + } +}) +console.log(response) +---- + diff --git a/docs/doc_examples/3cd50a789b8e1f0ebbbc53a8d7ecf656.asciidoc b/docs/doc_examples/3cd50a789b8e1f0ebbbc53a8d7ecf656.asciidoc new file mode 100644 index 000000000..dd63318fe --- /dev/null +++ b/docs/doc_examples/3cd50a789b8e1f0ebbbc53a8d7ecf656.asciidoc @@ -0,0 +1,38 @@ +// 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: { + bool: { + should: [ + { + multi_match: { + query: 'Will Smith', + type: 'cross_fields', + fields: [ + 'first', + 'last' + ], + minimum_should_match: '50%' + } + }, + { + multi_match: { + query: 'Will Smith', + type: 'cross_fields', + fields: [ + '*.edge' + ] + } + } + ] + } + } + } +}) +console.log(response) +---- + diff --git a/docs/doc_examples/43682666e1abcb14770c99f02eb26a0d.asciidoc b/docs/doc_examples/43682666e1abcb14770c99f02eb26a0d.asciidoc new file mode 100644 index 000000000..3fccfdec7 --- /dev/null +++ b/docs/doc_examples/43682666e1abcb14770c99f02eb26a0d.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.search({ + index: '*', + q: 'user:kimchy' +}) +console.log(response) +---- + diff --git a/docs/doc_examples/53b908c3432118c5a6e460f74d32006b.asciidoc b/docs/doc_examples/53b908c3432118c5a6e460f74d32006b.asciidoc new file mode 100644 index 000000000..519bfd36b --- /dev/null +++ b/docs/doc_examples/53b908c3432118c5a6e460f74d32006b.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.search({ + body: { + query: { + multi_match: { + query: 'this is a test', + fields: [ + 'subject', + 'message' + ] + } + } + } +}) +console.log(response) +---- + diff --git a/docs/doc_examples/53d938c754f36a912fcbe6473abb463f.asciidoc b/docs/doc_examples/53d938c754f36a912fcbe6473abb463f.asciidoc new file mode 100644 index 000000000..313a18ae4 --- /dev/null +++ b/docs/doc_examples/53d938c754f36a912fcbe6473abb463f.asciidoc @@ -0,0 +1,18 @@ +// 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.reindex({ + body: { + source: { + index: 'users' + }, + dest: { + index: 'new_users' + } + } +}) +console.log(response) +---- + diff --git a/docs/doc_examples/5be23858b35043fcb7b50fe36b873e6e.asciidoc b/docs/doc_examples/5be23858b35043fcb7b50fe36b873e6e.asciidoc new file mode 100644 index 000000000..9fc13cadc --- /dev/null +++ b/docs/doc_examples/5be23858b35043fcb7b50fe36b873e6e.asciidoc @@ -0,0 +1,18 @@ +// 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: 'twitter', + body: { + properties: { + email: { + type: 'keyword' + } + } + } +}) +console.log(response) +---- + diff --git a/docs/doc_examples/5d13a71fa7fda73b15111803b1c7cfd3.asciidoc b/docs/doc_examples/5c2f486c27bd5346e512265f93375d16.asciidoc similarity index 90% rename from docs/doc_examples/5d13a71fa7fda73b15111803b1c7cfd3.asciidoc rename to docs/doc_examples/5c2f486c27bd5346e512265f93375d16.asciidoc index f52af609f..8455b50c9 100644 --- a/docs/doc_examples/5d13a71fa7fda73b15111803b1c7cfd3.asciidoc +++ b/docs/doc_examples/5c2f486c27bd5346e512265f93375d16.asciidoc @@ -9,7 +9,7 @@ const response = await client.search({ range: { timestamp: { time_zone: '+01:00', - gte: '2015-01-01 00:00:00', + gte: '2020-01-01T00:00:00', lte: 'now' } } diff --git a/docs/doc_examples/5da6efd5b038ada64c9e853c88c1ec47.asciidoc b/docs/doc_examples/5da6efd5b038ada64c9e853c88c1ec47.asciidoc new file mode 100644 index 000000000..6157dc7f0 --- /dev/null +++ b/docs/doc_examples/5da6efd5b038ada64c9e853c88c1ec47.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.search({ + body: { + query: { + multi_match: { + query: 'brown fox', + type: 'best_fields', + fields: [ + 'subject', + 'message' + ], + tie_breaker: 0.3 + } + } + } +}) +console.log(response) +---- + diff --git a/docs/doc_examples/5f3a3eefeefe6fa85ec49d499212d245.asciidoc b/docs/doc_examples/5f3a3eefeefe6fa85ec49d499212d245.asciidoc new file mode 100644 index 000000000..2e6c1e650 --- /dev/null +++ b/docs/doc_examples/5f3a3eefeefe6fa85ec49d499212d245.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.putMapping({ + index: 'my_index', + body: { + properties: { + city: { + type: 'text', + fields: { + raw: { + type: 'keyword' + } + } + } + } + } +}) +console.log(response) +---- + diff --git a/docs/doc_examples/4466d410e06712c63328de4db249e6da.asciidoc b/docs/doc_examples/67ceac4bf2d9ac7cc500390544cdcb41.asciidoc similarity index 100% rename from docs/doc_examples/4466d410e06712c63328de4db249e6da.asciidoc rename to docs/doc_examples/67ceac4bf2d9ac7cc500390544cdcb41.asciidoc diff --git a/docs/doc_examples/68721288dc9ad8aa1b55099b4d303051.asciidoc b/docs/doc_examples/68721288dc9ad8aa1b55099b4d303051.asciidoc new file mode 100644 index 000000000..7dc6e69b6 --- /dev/null +++ b/docs/doc_examples/68721288dc9ad8aa1b55099b4d303051.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: { + multi_match: { + query: 'quick brown f', + type: 'bool_prefix', + fields: [ + 'subject', + 'message' + ] + } + } + } +}) +console.log(response) +---- + diff --git a/docs/doc_examples/6a1702dd50690cae833572e48a0ddf25.asciidoc b/docs/doc_examples/6a1702dd50690cae833572e48a0ddf25.asciidoc new file mode 100644 index 000000000..f4959e703 --- /dev/null +++ b/docs/doc_examples/6a1702dd50690cae833572e48a0ddf25.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.search({ + body: { + query: { + multi_match: { + query: 'Will Smith', + fields: [ + 'title', + '*_name' + ] + } + } + } +}) +console.log(response) +---- + diff --git a/docs/doc_examples/6bbc613bd4f9aec1bbdbabf5db021d28.asciidoc b/docs/doc_examples/6bbc613bd4f9aec1bbdbabf5db021d28.asciidoc new file mode 100644 index 000000000..9d44450c3 --- /dev/null +++ b/docs/doc_examples/6bbc613bd4f9aec1bbdbabf5db021d28.asciidoc @@ -0,0 +1,33 @@ +// 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: { + bool: { + should: [ + { + match: { + title: 'quick brown fox' + } + }, + { + match: { + 'title.original': 'quick brown fox' + } + }, + { + match: { + 'title.shingles': 'quick brown fox' + } + } + ] + } + } + } +}) +console.log(response) +---- + diff --git a/docs/doc_examples/6bf63f2ec6ba55fcaf1092f48212bf25.asciidoc b/docs/doc_examples/6bf63f2ec6ba55fcaf1092f48212bf25.asciidoc new file mode 100644 index 000000000..a252f320f --- /dev/null +++ b/docs/doc_examples/6bf63f2ec6ba55fcaf1092f48212bf25.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: { + user_identifier: { + type: 'keyword' + } + } + } + } +}) +console.log(response) +---- + diff --git a/docs/doc_examples/734c2e2a1e45b84f1e4e65b51356fcd7.asciidoc b/docs/doc_examples/734c2e2a1e45b84f1e4e65b51356fcd7.asciidoc new file mode 100644 index 000000000..af1817642 --- /dev/null +++ b/docs/doc_examples/734c2e2a1e45b84f1e4e65b51356fcd7.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: 'new_users', + body: { + mappings: { + properties: { + user_id: { + type: 'keyword' + } + } + } + } +}) +console.log(response) +---- + diff --git a/docs/doc_examples/7b908b1189f076942de8cd497ff1fa59.asciidoc b/docs/doc_examples/7b908b1189f076942de8cd497ff1fa59.asciidoc new file mode 100644 index 000000000..2107c116d --- /dev/null +++ b/docs/doc_examples/7b908b1189f076942de8cd497ff1fa59.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.search({ + body: { + query: { + multi_match: { + query: 'quick brown fox', + type: 'most_fields', + fields: [ + 'title', + 'title.original', + 'title.shingles' + ] + } + } + } +}) +console.log(response) +---- + diff --git a/docs/doc_examples/8022e6a690344035b6472a43a9d122e0.asciidoc b/docs/doc_examples/8022e6a690344035b6472a43a9d122e0.asciidoc new file mode 100644 index 000000000..eb8025f4e --- /dev/null +++ b/docs/doc_examples/8022e6a690344035b6472a43a9d122e0.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.search({ + index: '_all', + q: 'user:kimchy' +}) +console.log(response) +---- + diff --git a/docs/doc_examples/8cd00a3aba7c3c158277bc032aac2830.asciidoc b/docs/doc_examples/8cd00a3aba7c3c158277bc032aac2830.asciidoc new file mode 100644 index 000000000..bc1eb2c9b --- /dev/null +++ b/docs/doc_examples/8cd00a3aba7c3c158277bc032aac2830.asciidoc @@ -0,0 +1,80 @@ +// 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: '1', + _index: 'index1', + retry_on_conflict: 3 + } + }, + { + doc: { + field: 'value' + } + }, + { + update: { + _id: '0', + _index: 'index1', + retry_on_conflict: 3 + } + }, + { + script: { + source: 'ctx._source.counter += params.param1', + lang: 'painless', + params: { + param1: 1 + } + }, + upsert: { + counter: 1 + } + }, + { + update: { + _id: '2', + _index: 'index1', + retry_on_conflict: 3 + } + }, + { + doc: { + field: 'value' + }, + doc_as_upsert: true + }, + { + update: { + _id: '3', + _index: 'index1', + _source: true + } + }, + { + doc: { + field: 'value' + } + }, + { + update: { + _id: '4', + _index: 'index1' + } + }, + { + doc: { + field: 'value' + }, + _source: true + } + ] +}) +console.log(response) +---- + diff --git a/docs/doc_examples/98f14fddddea54a7d6149ab7b92e099d.asciidoc b/docs/doc_examples/98f14fddddea54a7d6149ab7b92e099d.asciidoc new file mode 100644 index 000000000..97b01621e --- /dev/null +++ b/docs/doc_examples/98f14fddddea54a7d6149ab7b92e099d.asciidoc @@ -0,0 +1,11 @@ +// 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.delete({ + index: 'twitter' +}) +console.log(response) +---- + diff --git a/docs/doc_examples/9bdd3c0d47e60c8cfafc8109f9369922.asciidoc b/docs/doc_examples/9bdd3c0d47e60c8cfafc8109f9369922.asciidoc new file mode 100644 index 000000000..20f588798 --- /dev/null +++ b/docs/doc_examples/9bdd3c0d47e60c8cfafc8109f9369922.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.search({ + index: 'twitter', + q: 'tag:wow' +}) +console.log(response) +---- + diff --git a/docs/doc_examples/97bcd92ef148312d41e69f0d18284327.asciidoc b/docs/doc_examples/a116949e446f34dc25ae57d4b703d0c1.asciidoc similarity index 100% rename from docs/doc_examples/97bcd92ef148312d41e69f0d18284327.asciidoc rename to docs/doc_examples/a116949e446f34dc25ae57d4b703d0c1.asciidoc diff --git a/docs/doc_examples/ad0dcbc7fc619e952c8825b8f307b7b2.asciidoc b/docs/doc_examples/ad0dcbc7fc619e952c8825b8f307b7b2.asciidoc new file mode 100644 index 000000000..ceac02596 --- /dev/null +++ b/docs/doc_examples/ad0dcbc7fc619e952c8825b8f307b7b2.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: { + multi_match: { + query: 'Jon', + type: 'cross_fields', + fields: [ + 'first', + 'first.edge', + 'last', + 'last.edge' + ] + } + } + } +}) +console.log(response) +---- + diff --git a/docs/doc_examples/ae9ccfaa146731ab9176df90670db1c2.asciidoc b/docs/doc_examples/ae9ccfaa146731ab9176df90670db1c2.asciidoc new file mode 100644 index 000000000..fd3601872 --- /dev/null +++ b/docs/doc_examples/ae9ccfaa146731ab9176df90670db1c2.asciidoc @@ -0,0 +1,47 @@ +// 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: [ + { + index: { + _index: 'test', + _id: '1' + } + }, + { + field1: 'value1' + }, + { + delete: { + _index: 'test', + _id: '2' + } + }, + { + create: { + _index: 'test', + _id: '3' + } + }, + { + field1: 'value3' + }, + { + update: { + _id: '1', + _index: 'test' + } + }, + { + doc: { + field2: 'value2' + } + } + ] +}) +console.log(response) +---- + diff --git a/docs/doc_examples/afc29b61c532cf683f749baf013e7bfe.asciidoc b/docs/doc_examples/afc29b61c532cf683f749baf013e7bfe.asciidoc new file mode 100644 index 000000000..44d30f594 --- /dev/null +++ b/docs/doc_examples/afc29b61c532cf683f749baf013e7bfe.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: { + user_id: { + type: 'alias', + path: 'user_identifier' + } + } + } +}) +console.log(response) +---- + diff --git a/docs/doc_examples/b0eaf67e5cce24ef8889bf20951ccec1.asciidoc b/docs/doc_examples/b0eaf67e5cce24ef8889bf20951ccec1.asciidoc new file mode 100644 index 000000000..02f53cb9a --- /dev/null +++ b/docs/doc_examples/b0eaf67e5cce24ef8889bf20951ccec1.asciidoc @@ -0,0 +1,29 @@ +// 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: { + dis_max: { + queries: [ + { + match: { + subject: 'brown fox' + } + }, + { + match: { + message: 'brown fox' + } + } + ], + tie_breaker: 0.3 + } + } + } +}) +console.log(response) +---- + diff --git a/docs/doc_examples/bd5918ab903c0889bb1f09c8c2466e43.asciidoc b/docs/doc_examples/bd5918ab903c0889bb1f09c8c2466e43.asciidoc new file mode 100644 index 000000000..b8e035f6f --- /dev/null +++ b/docs/doc_examples/bd5918ab903c0889bb1f09c8c2466e43.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: 'users', + body: { + mappings: { + properties: { + user_id: { + type: 'long' + } + } + } + } +}) +console.log(response) +---- + diff --git a/docs/doc_examples/be49260e1b3496c4feac38c56ebb0669.asciidoc b/docs/doc_examples/be49260e1b3496c4feac38c56ebb0669.asciidoc new file mode 100644 index 000000000..613044417 --- /dev/null +++ b/docs/doc_examples/be49260e1b3496c4feac38c56ebb0669.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.search({ + index: 'twitter', + q: 'user:kimchy' +}) +console.log(response) +---- + diff --git a/docs/doc_examples/c849c6c8f8659dbb93e1c14356f74e37.asciidoc b/docs/doc_examples/c849c6c8f8659dbb93e1c14356f74e37.asciidoc new file mode 100644 index 000000000..3b868e8eb --- /dev/null +++ b/docs/doc_examples/c849c6c8f8659dbb93e1c14356f74e37.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: { + city: { + type: 'text' + } + } + } + } +}) +console.log(response) +---- + diff --git a/docs/doc_examples/d9474f66970c6955e24b17c7447e7b5f.asciidoc b/docs/doc_examples/d9474f66970c6955e24b17c7447e7b5f.asciidoc new file mode 100644 index 000000000..789b778b3 --- /dev/null +++ b/docs/doc_examples/d9474f66970c6955e24b17c7447e7b5f.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.indices.create({ + index: 'my_index', + body: { + mappings: { + properties: { + name: { + properties: { + first: { + type: 'text' + } + } + } + } + } + } +}) +console.log(response) +---- + diff --git a/docs/doc_examples/e270f3f721a5712cd11a5ca03554f5b0.asciidoc b/docs/doc_examples/e270f3f721a5712cd11a5ca03554f5b0.asciidoc new file mode 100644 index 000000000..74cdf053b --- /dev/null +++ b/docs/doc_examples/e270f3f721a5712cd11a5ca03554f5b0.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.search({ + body: { + query: { + multi_match: { + query: 'Will Smith', + type: 'best_fields', + fields: [ + 'first_name', + 'last_name' + ], + operator: 'and' + } + } + } +}) +console.log(response) +---- + diff --git a/docs/doc_examples/e30ea6e3823a139d7693d8cce1920a06.asciidoc b/docs/doc_examples/e30ea6e3823a139d7693d8cce1920a06.asciidoc new file mode 100644 index 000000000..6317ce7bb --- /dev/null +++ b/docs/doc_examples/e30ea6e3823a139d7693d8cce1920a06.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.search({ + body: { + query: { + multi_match: { + query: 'this is a test', + fields: [ + 'subject^3', + 'message' + ] + } + } + } +}) +console.log(response) +---- + diff --git a/docs/doc_examples/e4be53736bcc02b03068fd72fdbfe271.asciidoc b/docs/doc_examples/e4be53736bcc02b03068fd72fdbfe271.asciidoc new file mode 100644 index 000000000..bb1a7d6bb --- /dev/null +++ b/docs/doc_examples/e4be53736bcc02b03068fd72fdbfe271.asciidoc @@ -0,0 +1,18 @@ +// 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: 'publications', + body: { + properties: { + title: { + type: 'text' + } + } + } +}) +console.log(response) +---- + diff --git a/docs/doc_examples/f5569945024b9d664828693705c27c1a.asciidoc b/docs/doc_examples/f5569945024b9d664828693705c27c1a.asciidoc new file mode 100644 index 000000000..5218065d0 --- /dev/null +++ b/docs/doc_examples/f5569945024b9d664828693705c27c1a.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.search({ + index: 'kimchy,elasticsearch', + q: 'user:kimchy' +}) +console.log(response) +---- + diff --git a/docs/doc_examples/f8cc4b331a19ff4df8e4a490f906ee69.asciidoc b/docs/doc_examples/f8cc4b331a19ff4df8e4a490f906ee69.asciidoc index 747469daf..0843c75f3 100644 --- a/docs/doc_examples/f8cc4b331a19ff4df8e4a490f906ee69.asciidoc +++ b/docs/doc_examples/f8cc4b331a19ff4df8e4a490f906ee69.asciidoc @@ -4,7 +4,7 @@ [source, js] ---- const response = await client.cat.health({ - v: '' + v: true }) console.log(response) ---- diff --git a/scripts/generate-docs-examples.js b/scripts/generate-docs-examples.js index e28791586..057cee5b1 100644 --- a/scripts/generate-docs-examples.js +++ b/scripts/generate-docs-examples.js @@ -44,7 +44,12 @@ const enabledFiles = [ 'indices/create-index.asciidoc', 'docs/index_.asciidoc', 'aggregations/bucket/terms-aggregation.asciidoc', - 'query-dsl/range-query.asciidoc' + 'query-dsl/range-query.asciidoc', + 'search/search.asciidoc', + 'query-dsl/multi-match-query.asciidoc', + 'docs/bulk.asciidoc', + 'indices/delete-index.asciidoc', + 'indices/put-mapping.asciidoc' ] function generate () {