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.
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.
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.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.