Skip to content

Commit

Permalink
Add missing snippets (#2113)
Browse files Browse the repository at this point in the history
For elastic/devtools-team#728

(cherry picked from commit 5413eb5)
  • Loading branch information
JoshMock authored and github-actions[bot] committed Dec 14, 2023
1 parent 5ea47d8 commit 3e02cb3
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 0 deletions.
12 changes: 12 additions & 0 deletions docs/doc_examples/36b86b97feedcf5632824eefc251d6ed.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[source,js]
----
const response = await client.search({
index: 'books',
query: {
match: {
name: 'brave'
}
}
})
console.log(response)
----
13 changes: 13 additions & 0 deletions docs/doc_examples/8575c966b004fb124c7afd6bb5827b50.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[source,js]
----
const response = await client.index({
index: 'books',
document: {
name: 'Snow Crash',
author: 'Neal Stephenson',
release_date: '1992-06-01',
page_count: 470,
}
})
console.log(response)
----
7 changes: 7 additions & 0 deletions docs/doc_examples/bcc75fc01b45e482638c65b8fbdf09fa.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[source,js]
----
const response = await client.search({
index: 'books'
})
console.log(response)
----
43 changes: 43 additions & 0 deletions docs/doc_examples/d04f0c8c44e8b4fb55f2e7d9d05977e7.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
[source,js]
----
const response = await client.bulk({
operations: [
{ 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,
}
]
})
console.log(response)
----

0 comments on commit 3e02cb3

Please sign in to comment.