Sofien.011
Sofien.011

Reputation: 39

Elasticsearch Query match_all

I am using Elasticsearch 1.5.2. I have an index with 278 stored products. I check that they are stored in head plugin. When Run a query of match_all I get only 10 hits however the total is 278. I get this result:

{
   "took": 3,
   "timed_out": false,
   "_shards": {
      "total": 5,
      "successful": 5,
      "failed": 0
   },
   "hits": {
      "total": 278,
      "max_score": 1,
      "hits": [.................only 10 products.......]

I want that I get in hits all my 278 results.

Upvotes: 0

Views: 2130

Answers (1)

Doron Yaacoby
Doron Yaacoby

Reputation: 9770

You need to pass in a size parameter to your query, like this:

 POST /_search
 {
  "from" : 0, "size" : 300,
  "query" : {
      "match_all":{}
   }
 }

The default is just 10 documents.

Upvotes: 2

Related Questions