Update quick_start.asciidoc

Fixed the example with the filtered query, missing the top-level `query` parameter
This commit is contained in:
Clinton Gormley
2015-06-08 11:45:24 +02:00
parent eebd7d117b
commit 6871d4bc0d

View File

@ -123,30 +123,31 @@ client.search({
from: (pageNum - 1) * perPage,
size: perPage,
body: {
filtered: {
query: {
match: {
// match the query agains all of
// the fields in the posts index
_all: userQuery
}
},
filter: {
// only return documents that are
// public or owned by the current user
or: [
{
term: { privacy: "public" }
},
{
term: { owner: userId }
query: {
filtered: {
query: {
match: {
// match the query agains all of
// the fields in the posts index
_all: userQuery
}
]
},
filter: {
// only return documents that are
// public or owned by the current user
or: [
{
term: { privacy: "public" }
},
{
term: { owner: userId }
}
]
}
}
}
}
}, function (error, response) {
if (err) {
}, function (error, response) {
if (err) {
// handle error
return;
}