Files
elasticsearch-js/docs/_examples/search.asciidoc
Spencer 83a464ac66 Update docs to use async/await (#667)
* [docs] update readme and examples to use async/await

* [apis] regenerate (including updated examples)
2018-05-23 14:31:34 -07:00

31 lines
502 B
Plaintext

.Search with a simple query string query
[source,js]
---------
const response = await client.search({
index: 'myindex',
q: 'title:test'
});
---------
.Passing a full request definition in the Elasticsearch's Query DSL as a `Hash`
[source,js]
---------
const response = await client.search({
index: 'myindex',
body: {
query: {
match: {
title: 'test'
}
},
facets: {
tags: {
terms: {
field: 'tags'
}
}
}
}
});
---------