summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Newson <rnewson@apache.org>2022-02-09 15:55:16 +0000
committerRobert Newson <rnewson@apache.org>2022-02-10 20:55:27 +0000
commit1e83aa317c6fb8bb85e775d7ccc8261347328bff (patch)
tree9e814cb5da899aaa2bdb013a233e120d0812912f
parentd97b5cee19a0d942078714a7b4d04517e132761d (diff)
downloadcouchdb-1e83aa317c6fb8bb85e775d7ccc8261347328bff.tar.gz
Include index sig in _search_info response
-rw-r--r--src/dreyfus/src/dreyfus_fabric_info.erl2
-rw-r--r--src/dreyfus/src/dreyfus_rpc.erl9
2 files changed, 9 insertions, 2 deletions
diff --git a/src/dreyfus/src/dreyfus_fabric_info.erl b/src/dreyfus/src/dreyfus_fabric_info.erl
index 5ca589c1d..8c7ae70c1 100644
--- a/src/dreyfus/src/dreyfus_fabric_info.erl
+++ b/src/dreyfus/src/dreyfus_fabric_info.erl
@@ -102,6 +102,8 @@ merge_results(Info) ->
[{committed_seq, lists:sum(X)} | Acc];
(pending_seq, X, Acc) ->
[{pending_seq, lists:sum(X)} | Acc];
+ (signature, [X | _], Acc) ->
+ [{signature, X} | Acc];
(_, _, Acc) ->
Acc
end,
diff --git a/src/dreyfus/src/dreyfus_rpc.erl b/src/dreyfus/src/dreyfus_rpc.erl
index 08b719435..2ebc5ffe5 100644
--- a/src/dreyfus/src/dreyfus_rpc.erl
+++ b/src/dreyfus/src/dreyfus_rpc.erl
@@ -80,8 +80,13 @@ info_int(DbName, DDoc, IndexName) ->
{ok, Index} ->
case dreyfus_index_manager:get_index(DbName, Index) of
{ok, Pid} ->
- Result = dreyfus_index:info(Pid),
- rexi:reply(Result);
+ case dreyfus_index:info(Pid) of
+ {ok, Fields} ->
+ Info = [{signature, Index#index.sig} | Fields],
+ rexi:reply({ok, Info});
+ Else ->
+ rexi:reply(Else)
+ end;
Error ->
rexi:reply(Error)
end;