mongoose-elasticsearch-xp icon indicating copy to clipboard operation
mongoose-elasticsearch-xp copied to clipboard

How to chane the size of search reponse? By default its giving only 10 search results.

Open ashish-k-mi opened this issue 7 years ago • 3 comments
trafficstars

ashish-k-mi avatar Feb 16 '18 09:02 ashish-k-mi

We can use size parameter in searchOptions when querying the data.

Example:

let query = {
  'query': {
    'bool': {
      'filter': [
        // Do some query
    ]}
  }
}

let searchOptions = {
  size: 25, // Here we use size
  hydrate: true
}
ModelName.esSearch(query, searchOptions, function (error, results) {
  // Do something with results
})

yvsssantosh avatar Mar 21 '18 09:03 yvsssantosh

Hi, Are search options working with Lucene syntax? I still get 10 results with size option set to 20.

brakulla avatar Sep 08 '18 19:09 brakulla

Hi,

I've checked the esSearch source code and I don't see any support for es pagination (https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-from-size.html) I've tried with the size option, this doesn't have any effect. Any plans on supporting this?

Kind regards, Yannick

visyan avatar Mar 15 '19 16:03 visyan