Answer the question
In order to leave comments, you need to log in
How to search given data in elasticsearch with from & size fields?
Good day.
There is a module https://github.com/mongoosastic/mongoosastic
In elasticsearch.js This is done like this:
client.search({
index: 'posts',
from: (pageNum - 1) * perPage,
size: perPage,
Post.search({
query_string: {
query: 'client',
},
from: 3,
size: 3
}
Answer the question
In order to leave comments, you need to log in
If I understand your nodejs correctly, then judging by the source of the schema.statics.search function, the request should look something like this:
Post.search(
{query_string: {query: 'client'}},
{from: 3, size: 3},
function() { /* callback */ }
);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question