willholley commented on a change in pull request #808: Add selector support for 
json indexes
URL: https://github.com/apache/couchdb/pull/808#discussion_r138633340
 
 

 ##########
 File path: src/mango/src/mango_native_proc.erl
 ##########
 @@ -135,19 +135,30 @@ index_doc(#st{indexes=Indexes}, Doc) ->
 
 get_index_entries({IdxProps}, Doc) ->
     {Fields} = couch_util:get_value(<<"fields">>, IdxProps),
-    Values = lists:map(fun({Field, _Dir}) ->
+    Selector = case couch_util:get_value(<<"selector">>, IdxProps) of
+        [] -> {[]};
+        Else -> Else
+    end,
+    case should_index(Selector, Doc) of
 
 Review comment:
   perhaps consider factoring out the duplication here with `get_text_entries`
 
----------------------------------------------------------------
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