Skip to content

Commit 711069e

Browse files
committed
[DOCS] Adds doc examples for Elasticsearch Quick start guide
https://www.elastic.co/guide/en/elasticsearch/reference/master/getting-started.html
1 parent 7787e41 commit 711069e

5 files changed

+51
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[source, ruby]
2+
----
3+
response = client.search(
4+
index: 'books',
5+
body: { query: { match: { name: 'brave' } } }
6+
)
7+
puts response
8+
----
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[source, ruby]
2+
----
3+
response = client.info
4+
puts response
5+
----
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[source, ruby]
2+
----
3+
response = client.index(
4+
index: 'books',
5+
body: {
6+
name: 'Snow Crash',
7+
author: 'Neal Stephenson',
8+
release_date: '1992-06-01',
9+
page_count: 470
10+
}
11+
)
12+
puts response
13+
----
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[source, ruby]
2+
----
3+
response = client.search(
4+
index: 'books'
5+
)
6+
puts response
7+
----
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[source, ruby]
2+
----
3+
response = client.bulk(
4+
body: [
5+
{ index: { _index: 'books' } },
6+
{ name: 'Revelation Space', author: 'Alastair Reynolds', release_date: '2000-03-15', page_count: 585},
7+
{ index: { _index: 'books' } },
8+
{ name: '1984', author: 'George Orwell', release_date: '1985-06-01', page_count: 328},
9+
{ index: { _index: 'books' } },
10+
{ name: 'Fahrenheit 451', author: 'Ray Bradbury', release_date: '1953-10-15', page_count: 227},
11+
{ index: { _index: 'books' } },
12+
{ name: 'Brave New World', author: 'Aldous Huxley', release_date: '1932-06-01', page_count: 268},
13+
{ index: { _index: 'books' } },
14+
{ name: 'The Handmaids Tale', author: 'Margaret Atwood', release_date: '1985-06-01', page_count: 311}
15+
]
16+
)
17+
puts response
18+
----

0 commit comments

Comments
 (0)