# Search size with JSON body is sensible to key order (Elasticsearch 2.1.1) (bug?)

**URL:** <https://discuss.elastic.co/t/search-size-with-json-body-is-sensible-to-key-order-elasticsearch-2-1-1-bug/39792>\
**Category:** Elasticsearch\
**Created:** [January 21, 2016, 3:43pm UTC](https://discuss.elastic.co/t/search-size-with-json-body-is-sensible-to-key-order-elasticsearch-2-1-1-bug/39792 "2016-01-21T15:43:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kaplun](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kaplun/32/30420_2.png) [@kaplun](https://discuss.elastic.co/u/kaplun)\
**Post date:** [January 21, 2016, 3:43pm UTC](https://discuss.elastic.co/t/search-size-with-json-body-is-sensible-to-key-order-elasticsearch-2-1-1-bug/39792/1 "2016-01-21T15:43:40Z")

</div>

In our installation the number of results depends on the position of the 'size' key in the request.  
e.g.  
`curl -XPOST localhost:9200/hep/_search -d '{ "size": 25, "query": { "multi_match": { "message": { "fields": ["title^3", "title.raw^10", "abstract^2", "abstract.raw^4", "author^10", "author.raw^15", "reportnumber^10", "eprint^10", "doi^10"], "operator": "or", "query": "ellis ", "zero_terms_query": "all" } } } }' -o /tmp/size`  
Vs.  
`curl -XPOST localhost:9200/hep/_search -d '{ "query": { "multi_match": { "message": { "fields": ["title^3", "title.raw^10", "abstract^2", "abstract.raw^4", "author^10", "author.raw^15", "reportnumber^10", "eprint^10", "doi^10"], "operator": "or", "query": "ellis ", "zero_terms_query": "all" } } }, "size":25 }' -o /tmp/size2`

Gives two different results:  
`wc /tmp/size* 0 2293415 24129993 /tmp/size 0 697658 7396394 /tmp/size2`

Somehow when `size` is last, it is ignored (and default value of 10 is used).

Note that this seems not to be the case on ES 2.0.0

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 5, 2017, 11:22pm UTC](https://discuss.elastic.co/t/search-size-with-json-body-is-sensible-to-key-order-elasticsearch-2-1-1-bug/39792/3 "2017-07-05T23:22:29Z")

</div>


