From 224872a7d51cc41eb0da67b36f7fdbc55b99367a Mon Sep 17 00:00:00 2001 From: Fernando Briano Date: Thu, 7 Dec 2023 10:34:06 +0000 Subject: [PATCH] [DOCS] Adds doc examples for Elasticsearch Quick start guide https://www.elastic.co/guide/en/elasticsearch/reference/master/getting-started.html --- .../36b86b97feedcf5632824eefc251d6ed.asciidoc | 8 ++++++++ .../3d1ff6097e2359f927c88c2ccdb36252.asciidoc | 5 +++++ .../8575c966b004fb124c7afd6bb5827b50.asciidoc | 13 +++++++++++++ .../bcc75fc01b45e482638c65b8fbdf09fa.asciidoc | 7 +++++++ .../d04f0c8c44e8b4fb55f2e7d9d05977e7.asciidoc | 18 ++++++++++++++++++ 5 files changed, 51 insertions(+) create mode 100644 docs/examples/guide/36b86b97feedcf5632824eefc251d6ed.asciidoc create mode 100644 docs/examples/guide/3d1ff6097e2359f927c88c2ccdb36252.asciidoc create mode 100644 docs/examples/guide/8575c966b004fb124c7afd6bb5827b50.asciidoc create mode 100644 docs/examples/guide/bcc75fc01b45e482638c65b8fbdf09fa.asciidoc create mode 100644 docs/examples/guide/d04f0c8c44e8b4fb55f2e7d9d05977e7.asciidoc diff --git a/docs/examples/guide/36b86b97feedcf5632824eefc251d6ed.asciidoc b/docs/examples/guide/36b86b97feedcf5632824eefc251d6ed.asciidoc new file mode 100644 index 0000000000..718fd3338a --- /dev/null +++ b/docs/examples/guide/36b86b97feedcf5632824eefc251d6ed.asciidoc @@ -0,0 +1,8 @@ +[source, ruby] +---- +response = client.search( + index: 'books', + body: { query: { match: { name: 'brave' } } } +) +puts response +---- diff --git a/docs/examples/guide/3d1ff6097e2359f927c88c2ccdb36252.asciidoc b/docs/examples/guide/3d1ff6097e2359f927c88c2ccdb36252.asciidoc new file mode 100644 index 0000000000..e6a88d209d --- /dev/null +++ b/docs/examples/guide/3d1ff6097e2359f927c88c2ccdb36252.asciidoc @@ -0,0 +1,5 @@ +[source, ruby] +---- +response = client.info +puts response +---- diff --git a/docs/examples/guide/8575c966b004fb124c7afd6bb5827b50.asciidoc b/docs/examples/guide/8575c966b004fb124c7afd6bb5827b50.asciidoc new file mode 100644 index 0000000000..e85d828755 --- /dev/null +++ b/docs/examples/guide/8575c966b004fb124c7afd6bb5827b50.asciidoc @@ -0,0 +1,13 @@ +[source, ruby] +---- +response = client.index( + index: 'books', + body: { + name: 'Snow Crash', + author: 'Neal Stephenson', + release_date: '1992-06-01', + page_count: 470 + } +) +puts response +---- diff --git a/docs/examples/guide/bcc75fc01b45e482638c65b8fbdf09fa.asciidoc b/docs/examples/guide/bcc75fc01b45e482638c65b8fbdf09fa.asciidoc new file mode 100644 index 0000000000..1847170105 --- /dev/null +++ b/docs/examples/guide/bcc75fc01b45e482638c65b8fbdf09fa.asciidoc @@ -0,0 +1,7 @@ +[source, ruby] +---- +response = client.search( + index: 'books' +) +puts response +---- diff --git a/docs/examples/guide/d04f0c8c44e8b4fb55f2e7d9d05977e7.asciidoc b/docs/examples/guide/d04f0c8c44e8b4fb55f2e7d9d05977e7.asciidoc new file mode 100644 index 0000000000..31b2253437 --- /dev/null +++ b/docs/examples/guide/d04f0c8c44e8b4fb55f2e7d9d05977e7.asciidoc @@ -0,0 +1,18 @@ +[source, ruby] +---- +response = client.bulk( + body: [ + { index: { _index: 'books' } }, + { name: 'Revelation Space', author: 'Alastair Reynolds', release_date: '2000-03-15', page_count: 585}, + { index: { _index: 'books' } }, + { name: '1984', author: 'George Orwell', release_date: '1985-06-01', page_count: 328}, + { index: { _index: 'books' } }, + { name: 'Fahrenheit 451', author: 'Ray Bradbury', release_date: '1953-10-15', page_count: 227}, + { index: { _index: 'books' } }, + { name: 'Brave New World', author: 'Aldous Huxley', release_date: '1932-06-01', page_count: 268}, + { index: { _index: 'books' } }, + { name: 'The Handmaids Tale', author: 'Margaret Atwood', release_date: '1985-06-01', page_count: 311} + ] +) +puts response +----