Search code examples
elasticsearchsense

How to disable pagination in sense plugin while query elastic search


I'm using elastic search for making global search for that I'm using sense plugin for poc but while I'm hitting my query with sense I get paginated data but I want all data in a single query.

            GET /_search?q=2016

My result is this:

{
  "took": 7,
  "timed_out": false,
  "_shards": {
    "total": 21,
    "successful": 21,
    "failed": 0
  },
  "hits": {
    "total": 465,
    "max_score": 0.3500354,
    "hits":[ 


Solution

  • By default Elasticsearch returns 10 documents per request. You can use the 'size' param to retrieve more products with one query, like:

    GET /_search?q=2016&size=465
    

    Note that there is a limit on the max results per request (defaults to 10.000), as described here