basho/riak_kv — pull request #738 by engelsanchez (2013-11-27 14:54:20+00:00)
Title: Make 2i pagination sort optional - 1.4 branch version

This addresses the performance penalty from the new default of sorting
2i results since pagination was added. When paginating, (max_results
set) sorting is always enabled. But when not, it will only be used if
configured in app.config or specified in the client request.

This is a backport to 1.4 of https://github.com/basho/riak_kv/pull/671 with two main differences:

* The parameter name has been changed from 'sort' to 'pagination_sort' to help avoid confusion with its meaning since we don't use a "natural" sort based on keys, but rather (term, key) as is required by pagination.
* The call to app_helper:get_env to get the default for the global switch has an in-code default of false. This is necessary so that it defaults to false without any config. The 2.0 version was relying on cuttlefish, but even there it's necessary for deployments with legacy configuration files.