pgj commented on code in PR #4792:
URL: https://github.com/apache/couchdb/pull/4792#discussion_r1347583775
##########
src/mango/src/mango_cursor.erl:
##########
@@ -53,8 +53,24 @@ create(Db, Selector0, Opts, Kind) ->
{UsableIndexes, Trace} = mango_idx:get_usable_indexes(Db, Selector, Opts,
Kind),
case maybe_filter_indexes_by_ddoc(UsableIndexes, Opts) of
[] ->
- % use_index doesn't match a valid index - fall back to a valid one
- create_cursor(Db, {UsableIndexes, Trace}, Selector, Opts);
+ % use_index doesn't match a valid index - determine how
+ % this shall be handled by the further settings
+ case allow_fallback(Opts) of
+ true ->
+ % fall back to a valid index
+ create_cursor(Db, {UsableIndexes, Trace}, Selector, Opts);
+ false ->
+ % return an error
+ Details =
+ case use_index(Opts) of
+ [] ->
+ [];
+ UseIndex ->
+ [DesignId | Rest] = UseIndex,
+ [ddoc_name(DesignId) | Rest]
Review Comment:
This is now fixed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]