davisp commented on a change in pull request #1376: Add fields to sort based on
selector
URL: https://github.com/apache/couchdb/pull/1376#discussion_r196156863
##########
File path: src/mango/src/mango_idx_special.erl
##########
@@ -63,9 +65,11 @@ columns(#idx{def=all_docs}) ->
[<<"_id">>].
-is_usable(#idx{def=all_docs}, Selector, _) ->
+is_usable(#idx{def=all_docs}, _Selector, []) ->
+ true;
+is_usable(#idx{def=all_docs} = Idx, Selector, SortFields) ->
Fields = mango_idx_view:indexable_fields(Selector),
- lists:member(<<"_id">>, Fields).
+ lists:member(<<"_id">>, Fields) and maybe_filter_by_sort_fields(Idx,
SortFields, Selector).
Review comment:
Can you rename `maybe_filter_by_sort_fields` `can_use_sort` like you did for
views. Also no need to export it any longer.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services