You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by rn...@apache.org on 2023/04/06 11:40:12 UTC

[couchdb] branch import-nouveau-singlelucene updated (eed30eb90 -> 884978e5a)

This is an automated email from the ASF dual-hosted git repository.

rnewson pushed a change to branch import-nouveau-singlelucene
in repository https://gitbox.apache.org/repos/asf/couchdb.git


    from eed30eb90 flatten to one project, one lucene
     new 577245c20 unused import
     new 884978e5a they're called hits

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../couchdb/nouveau/resources/BaseIndexResource.java |  1 -
 src/nouveau/src/nouveau_httpd.erl                    | 20 ++++++++++----------
 2 files changed, 10 insertions(+), 11 deletions(-)


[couchdb] 02/02: they're called hits

Posted by rn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rnewson pushed a commit to branch import-nouveau-singlelucene
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 884978e5a6cbd2b928625202ecc782a197f052bd
Author: Robert Newson <rn...@apache.org>
AuthorDate: Thu Apr 6 12:39:56 2023 +0100

    they're called hits
---
 src/nouveau/src/nouveau_httpd.erl | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/src/nouveau/src/nouveau_httpd.erl b/src/nouveau/src/nouveau_httpd.erl
index 77f1f1b1a..902d5c813 100644
--- a/src/nouveau/src/nouveau_httpd.erl
+++ b/src/nouveau/src/nouveau_httpd.erl
@@ -101,16 +101,16 @@ handle_search_req(#httpd{} = Req, DbName, DDoc, IndexName, QueryArgs, Retry) ->
         {ok, SearchResults} ->
             RespBody = #{
                 <<"bookmark">> => nouveau_bookmark:pack(maps:get(bookmark, SearchResults)),
-                <<"total_rows">> => maps:get(<<"total_hits">>, SearchResults),
-                <<"total_rows_relation">> => maps:get(<<"total_hits_relation">>, SearchResults),
-                <<"rows">> => include_docs(
+                <<"total_hits">> => maps:get(<<"total_hits">>, SearchResults),
+                <<"total_hits_relation">> => maps:get(<<"total_hits_relation">>, SearchResults),
+                <<"hits">> => include_docs(
                     DbName, maps:get(<<"hits">>, SearchResults), IncludeDocs
                 ),
                 <<"counts">> => maps:get(<<"counts">>, SearchResults, null),
                 <<"ranges">> => maps:get(<<"ranges">>, SearchResults, null)
             },
-            RowCount = length(maps:get(<<"rows">>, RespBody)),
-            incr_stats(RowCount, IncludeDocs),
+            HitCount = length(maps:get(<<"hits">>, RespBody)),
+            incr_stats(HitCount, IncludeDocs),
             send_json(Req, 200, RespBody);
         {error, {service_unavailable, _}} when Retry > 1 ->
             timer:sleep(?RETRY_SLEEP),
@@ -160,11 +160,11 @@ include_docs(DbName, Hits, true) ->
     {ok, Docs} = nouveau_fabric:get_json_docs(DbName, Ids),
     lists:zipwith(fun(Hit, Doc) -> Hit#{<<"doc">> => Doc} end, Hits, Docs).
 
-incr_stats(RowCount, false) ->
-    chttpd_stats:incr_rows(RowCount);
-incr_stats(RowCount, true) ->
-    chttpd_stats:incr_reads(RowCount),
-    incr_stats(RowCount, false).
+incr_stats(HitCount, false) ->
+    chttpd_stats:incr_rows(HitCount);
+incr_stats(HitCount, true) ->
+    chttpd_stats:incr_reads(HitCount),
+    incr_stats(HitCount, false).
 
 parse_bool_param(_, Val) when is_boolean(Val) ->
     Val;


[couchdb] 01/02: unused import

Posted by rn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rnewson pushed a commit to branch import-nouveau-singlelucene
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 577245c20a0c37465eaf13899aa3774e5c3822f9
Author: Robert Newson <rn...@apache.org>
AuthorDate: Thu Apr 6 12:39:44 2023 +0100

    unused import
---
 .../java/org/apache/couchdb/nouveau/resources/BaseIndexResource.java     | 1 -
 1 file changed, 1 deletion(-)

diff --git a/nouveau/src/main/java/org/apache/couchdb/nouveau/resources/BaseIndexResource.java b/nouveau/src/main/java/org/apache/couchdb/nouveau/resources/BaseIndexResource.java
index 645cc3c29..68d728c40 100644
--- a/nouveau/src/main/java/org/apache/couchdb/nouveau/resources/BaseIndexResource.java
+++ b/nouveau/src/main/java/org/apache/couchdb/nouveau/resources/BaseIndexResource.java
@@ -14,7 +14,6 @@
 package org.apache.couchdb.nouveau.resources;
 
 import java.io.IOException;
-import java.util.Arrays;
 import java.util.List;
 
 import jakarta.validation.Valid;