diff options
author | Robert Newson <rnewson@apache.org> | 2023-04-06 12:39:56 +0100 |
---|---|---|
committer | Robert Newson <rnewson@apache.org> | 2023-04-06 12:39:56 +0100 |
commit | 884978e5a6cbd2b928625202ecc782a197f052bd (patch) | |
tree | 46d9e696a0dbd023804e3b37a808915b86a9e05d | |
parent | 577245c20a0c37465eaf13899aa3774e5c3822f9 (diff) | |
download | couchdb-import-nouveau-singlelucene.tar.gz |
they're called hitsimport-nouveau-singlelucene
-rw-r--r-- | src/nouveau/src/nouveau_httpd.erl | 20 |
1 files 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; |