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

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 {} ...

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

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.

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