Files
elasticsearch-js/docs/_examples/search.asciidoc
2013-12-27 16:41:38 -07:00

34 lines
537 B
Plaintext

.Search with a simple query string query
[source,js]
---------
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({
index: 'myindex',
body: {
query: {
match: {
title: 'test'
}
},
facets: {
tags: {
terms: {
field: 'tags'
}
}
}
}
}, function (error, response) {
// ...
}):
---------