garrensmith commented on a change in pull request #1423: Mango to nodes
URL: https://github.com/apache/couchdb/pull/1423#discussion_r200951686
 
 

 ##########
 File path: src/mango/src/mango_cursor_view.erl
 ##########
 @@ -332,17 +380,31 @@ apply_opts([{_, _} | Rest], Args) ->
     apply_opts(Rest, Args).
 
 
-doc_member(Db, RowProps, Opts, ExecutionStats) ->
+doc_member(Cursor, RowProps) ->
+    Db = Cursor#cursor.db, 
+    Opts = Cursor#cursor.opts,
+    ExecutionStats = Cursor#cursor.execution_stats,
+    Selector = Cursor#cursor.selector,
+    Incr = case couch_util:get_value(value, RowProps) of
+        N when is_integer(N) -> N;
+        _ -> 1
+    end,
     case couch_util:get_value(doc, RowProps) of
         {DocProps} ->
-            ExecutionStats1 = 
mango_execution_stats:incr_docs_examined(ExecutionStats),
+            ExecutionStats1 = 
mango_execution_stats:incr_docs_examined(ExecutionStats, Incr),
             {ok, {DocProps}, {execution_stats, ExecutionStats1}};
         undefined ->
             ExecutionStats1 = 
mango_execution_stats:incr_quorum_docs_examined(ExecutionStats),
             Id = couch_util:get_value(id, RowProps),
             case mango_util:defer(fabric, open_doc, [Db, Id, Opts]) of
-                {ok, #doc{}=Doc} ->
-                    {ok, couch_doc:to_json_obj(Doc, []), {execution_stats, 
ExecutionStats1}};
+                {ok, #doc{}=DocProps} ->
+                    Doc = couch_doc:to_json_obj(DocProps, []),
+                    case mango_selector:match(Selector, Doc) of
 
 Review comment:
   I think we want to keep the quorum docs examined separate to the other docs 
examined.

----------------------------------------------------------------
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

Reply via email to