Answer the question
In order to leave comments, you need to log in
How to make an additional validation field in mongoosastic?
Of course, I'm sorry :D I'm going to be the most fludder of the DB category today ))
But .. How can I add a check in mongoosastic that the post has an access : true field?
Post.search({
query_string: {query: req.params.q}},
{
from: (curPage - 1) * perPage,
size: perPage,
sort: 'num:desc',},
function(err, results) {
...
Answer the question
In order to leave comments, you need to log in
Filtered query , Term filter
I think so:
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) {
}
)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question