Skip to content

Commit

Permalink
[DOCS] Adds doc examples for Elasticsearch Quick start guide
Browse files Browse the repository at this point in the history
  • Loading branch information
picandocodigo committed Dec 7, 2023
1 parent 1e3561e commit 224872a
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 0 deletions.
8 changes: 8 additions & 0 deletions docs/examples/guide/36b86b97feedcf5632824eefc251d6ed.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[source, ruby]
----
response = client.search(
index: 'books',
body: { query: { match: { name: 'brave' } } }
)
puts response
----
5 changes: 5 additions & 0 deletions docs/examples/guide/3d1ff6097e2359f927c88c2ccdb36252.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[source, ruby]
----
response = client.info
puts response
----
13 changes: 13 additions & 0 deletions docs/examples/guide/8575c966b004fb124c7afd6bb5827b50.asciidoc
Original file line number Diff line number Diff line change
@@ -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
----
7 changes: 7 additions & 0 deletions docs/examples/guide/bcc75fc01b45e482638c65b8fbdf09fa.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[source, ruby]
----
response = client.search(
index: 'books'
)
puts response
----
18 changes: 18 additions & 0 deletions docs/examples/guide/d04f0c8c44e8b4fb55f2e7d9d05977e7.asciidoc
Original file line number Diff line number Diff line change
@@ -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
----

0 comments on commit 224872a

Please sign in to comment.