This issue came up during our meeting last week and it was suggested to ask the 
API working group for its opinion, so any comments welcome.

Searchlight was born out of the Glance codebase, and so implemented "offset" 
and "limit" as paging parameters [1]. Where possible we've tried to map closely 
to Elasticsearch's API so that we don't have to translate parts of the query 
body into Elasticsearch's DSL (with the testing and documentation that comes 
along with it). Elasticsearch implements the same paging parameters as 'size' 
and 'from'.

Because at present we require an amount of knowledge of Elasticsearch's query 
language in order to use Searchlight, I proposed 
https://review.openstack.org/#/c/381956/ last week to add 'size' and 'from' as 
synonyms for 'offset' and 'limit' (and incidentally, we do plan to add a more 
scrolling/cursor-based method to work around the temporal problems with 
offset/limit). The two issues noted by folks:

* Having two parameters doing the same thing can be confusing (which in general 
I agree with though in this case I feel it's defensible)
* 'size' is ambiguous when it's part of a set of APIs as large as the Openstack 

This obviously isn't life threatening, more of a convenience for a number of 
people who's expressed frustration with getting the parameter names wrong, but 
does anyone on the API WG have a strong opinion against doing it?



[1] I am aware of the discussions around paging versus 'marker'-based 
scrolling. We plan to add support for a more cursor-like method as well, but 
Elasticsearch has always supported paging.
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe

Reply via email to