Backports the following commits to 15.x: - Update docs to use async/await (#667)
This commit is contained in:
@ -1,18 +1,16 @@
|
||||
.Search with a simple query string query
|
||||
[source,js]
|
||||
---------
|
||||
client.search({
|
||||
const response = await client.search({
|
||||
index: 'myindex',
|
||||
q: 'title:test'
|
||||
}, function (error, response) {
|
||||
// ...
|
||||
});
|
||||
---------
|
||||
|
||||
.Passing a full request definition in the Elasticsearch's Query DSL as a `Hash`
|
||||
[source,js]
|
||||
---------
|
||||
client.search({
|
||||
const response = await client.search({
|
||||
index: 'myindex',
|
||||
body: {
|
||||
query: {
|
||||
@ -28,7 +26,5 @@ client.search({
|
||||
}
|
||||
}
|
||||
}
|
||||
}, function (error, response) {
|
||||
// ...
|
||||
});
|
||||
---------
|
||||
---------
|
||||
|
||||
Reference in New Issue
Block a user