nickva commented on code in PR #5286:
URL: https://github.com/apache/couchdb/pull/5286#discussion_r1792543375


##########
src/nouveau/src/nouveau_fabric_search.erl:
##########
@@ -215,11 +222,43 @@ convert_item(Item) ->
             maps:get(<<"value">>, Item)
     end.
 
-merge_facets(FacetsA, null, _Limit) ->
+top_n_facets(SearchResults, TopN) ->
+    After = SearchResults#{
+        <<"counts">> => top_n_facets(<<"counts">>, SearchResults, TopN),

Review Comment:
   If we're updating existing keys, it's usually better to assert that with 
`:=`.



-- 
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: notifications-unsubscr...@couchdb.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to