garrensmith commented on a change in pull request #1376: Add fields to sort
based on selector
URL: https://github.com/apache/couchdb/pull/1376#discussion_r196692496
##########
File path: src/mango/src/mango_cursor.erl
##########
@@ -48,18 +48,12 @@
create(Db, Selector0, Opts) ->
Selector = mango_selector:normalize(Selector0),
UsableIndexes = mango_idx:get_usable_indexes(Db, Selector, Opts),
- case length(UsableIndexes) of
- 0 ->
- AllDocs = mango_idx:special(Db),
- create_cursor(Db, AllDocs, Selector, Opts);
Review comment:
No. The fallback happens in the mango_idx_special. The all_docs is added as
an index. Previously what would happen is in the `maybe_filter_by_sort` if
there were no sort fields defined it would return `{ok, []}`. That would then
be returned to the above case statement which would then use the
`mango_idx:special`. Now that check happens in the sort filtering inside the
mango_idx_special.
----------------------------------------------------------------
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