The arguments to the LIMIT clause appeared to be flipped/reversed in SQL compared to the description in the Basic Query page of the documentation.
That page says the first argument is similar to the
size parameter in Elasticsearch and the second argument is similar to the
from parameter. Therefore, they should indicate how many records are returned and the “starting” record, respectively. If you only specify one argument, it works as described. However, if you specify both arguments, the first is used as the
from parameter and the second is used for the
This can be clearly seen by looking at the JSON in the Translation window, as shown in this screenshot
Notice that the first arg in the LIMIT clause is “401” and is being mapped to the FROM item in the JSON translation while the second arg (1) is being mapped to SIZE.
When only one arg is provided, it is properly mapped to the SIZE parameter and FROM is set to 0.
I assume this is a bug in the SQL==>Elasticsearch translation although, I suppose, it could be a documentation bug.