# \[resolved\] Failing parameter ("size", "sort", ...) in query

**URL:** <https://discuss.elastic.co/t/resolved-failing-parameter-size-sort-in-query/89303>\
**Category:** Elasticsearch\
**Created:** [June 14, 2017, 6:34am UTC](https://discuss.elastic.co/t/resolved-failing-parameter-size-sort-in-query/89303 "2017-06-14T06:34:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![NeronLeVelu](https://avatars.discourse-cdn.com/v4/letter/n/f9ae1b/32.png) [@NeronLeVelu](https://discuss.elastic.co/u/NeronLeVelu)\
**Post date:** [June 14, 2017, 6:34am UTC](https://discuss.elastic.co/t/resolved-failing-parameter-size-sort-in-query/89303/1 "2017-06-14T06:34:38Z")

</div>

is there a parameter or configuration that change the behavior of the query "size" parameter.  
Using a Elastic 5.4.1 i was surprise that

```
GET _search
{ "size" : 1
  ,"query": {"match_all": {}}
}

```

found effectively millions of hits but return the traditionalm (default) 10 hits where I expect only 1. I try several format (size after the query, adding "from" attribut, specific index, ...) failed to return only 1 hit. A quick test on another Elastic confirm that the query should return 1 hit.

the head of reply show no problem

```
{
  "took": 187,
  "timed_out": false,
  "_shards": {
    "total": 321,
    "successful": 321,
    "failed": 0
  },
  "hits": {
    "total": 7471874,
    "max_score": 1,
    "hits": [ ... the 10 {} ...
```

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [June 14, 2017, 7:33am UTC](https://discuss.elastic.co/t/resolved-failing-parameter-size-sort-in-query/89303/2 "2017-06-14T07:33:31Z")

</div>

Hey,

your expectation is correct. Testing this locally worked for me as well (by copy/pasting your snippet).

can you supply a full recreation for us? Create an index, index more than one document and then execute the query? Also what is your setup? Which JVM version? Installed via RPM/Deb?

Just to be sure, you dont accidentally send a request using `?size=1` as a parameter or sth, as that would not work as expected.

--Alex

---

<div class="post-metadata">

**Author:** ![NeronLeVelu](https://avatars.discourse-cdn.com/v4/letter/n/f9ae1b/32.png) [@NeronLeVelu](https://discuss.elastic.co/u/NeronLeVelu)\
**Post date:** [June 14, 2017, 10:54am UTC](https://discuss.elastic.co/t/resolved-failing-parameter-size-sort-in-query/89303/3 "2017-06-14T10:54:02Z")

</div>

Found the problem. After a server patch, HTTP work without data tranmission on GET request (where it accept it before). Using the POST version solve the problem.

---

<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 12, 2017, 10:54am UTC](https://discuss.elastic.co/t/resolved-failing-parameter-size-sort-in-query/89303/4 "2017-07-12T10:54:28Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
