-
Notifications
You must be signed in to change notification settings - Fork 728
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
For elastic/devtools-team#728 (cherry picked from commit 5413eb5)
- Loading branch information
1 parent
5ea47d8
commit 3e02cb3
Showing
4 changed files
with
75 additions
and
0 deletions.
There are no files selected for viewing
12 changes: 12 additions & 0 deletions
12
docs/doc_examples/36b86b97feedcf5632824eefc251d6ed.asciidoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
13
docs/doc_examples/8575c966b004fb124c7afd6bb5827b50.asciidoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
---- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
43
docs/doc_examples/d04f0c8c44e8b4fb55f2e7d9d05977e7.asciidoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
---- |