Skip to content

Commit 187d212

Browse files
committed
!fixup: add toggle
1 parent adfc79b commit 187d212

3 files changed

Lines changed: 10 additions & 5 deletions

File tree

rel/overlay/etc/default.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -966,6 +966,7 @@ state_dir = {{state_dir}}
966966
; enable Search functionality.
967967
;name = clouseau@127.0.0.1
968968
name = {{clouseau_name}}
969+
path_keys = false
969970

970971
; CouchDB will try to re-connect to Clouseau using a bounded
971972
; exponential backoff with the following number of iterations.

src/dreyfus/src/clouseau_rpc.erl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
-include("dreyfus.hrl").
1818

19-
-export([index_key_from_pid/1, index_key_from_path/2, get_index_pid_from_key/1]).
19+
-export([index_key_from_pid/1, index_key_with_path/2, get_index_pid_from_key/1]).
2020
-export([open_index/3]).
2121
-export([await/2, commit/2, get_update_seq/1, info/1, search/2]).
2222
-export([group1/7, group2/2]).
@@ -54,12 +54,12 @@
5454
index_key_from_pid(Pid) when is_pid(Pid) ->
5555
{pid, Pid}.
5656

57-
-spec index_key_from_path(string_as_binary(_), pid()) -> indexer_key().
58-
index_key_from_path(Path, Pid) when is_pid(Pid) ->
57+
-spec index_key_with_path(string_as_binary(_), pid()) -> indexer_key().
58+
index_key_with_path(Path, Pid) when is_pid(Pid) ->
5959
{path, Path, Pid}.
6060

6161
-spec get_index_pid_from_key(indexer_key()) -> pid().
62-
get_index_pid_from_key({path, _, Pid}) ->
62+
get_index_pid_from_key({path, _Path, Pid}) ->
6363
Pid;
6464
get_index_pid_from_key({pid, Pid}) ->
6565
Pid.

src/dreyfus/src/dreyfus_index.erl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,11 @@ open_index(DbName, #index{analyzer = Analyzer, sig = Sig}) ->
290290
Path = <<DbName/binary, "/", Sig/binary>>,
291291
case clouseau_rpc:open_index(self(), Path, Analyzer) of
292292
{ok, Pid} ->
293-
Key = clouseau_rpc:index_key_from_pid(Pid),
293+
Key =
294+
case config:get_boolean("dreyfus", "path_keys", false) of
295+
true -> clouseau_rpc:index_key_with_path(Path, Pid);
296+
false -> clouseau_rpc:index_key_from_pid(Pid)
297+
end,
294298
case clouseau_rpc:get_update_seq(Key) of
295299
{ok, Seq} ->
296300
{ok, Key, Seq};

0 commit comments

Comments
 (0)