Post.search({
query_string: {query: req.params.q}},
{
from: (curPage - 1) * perPage,
size: perPage,
sort: 'num:desc',},
function(err, results) {
...
Post.search(
{
filtered: {
query: {
query_string: {
query: req.params.q
}
},
filter: {
term: {
access: true
}
}
}
},
{
from: (curPage - 1) * perPage,
size: perPage,
sort: 'num:desc'
},
function(err, results) {
}
)