diff options
Diffstat (limited to 'src/mango/src/mango_idx.erl')
-rw-r--r-- | src/mango/src/mango_idx.erl | 34 |
1 files changed, 29 insertions, 5 deletions
diff --git a/src/mango/src/mango_idx.erl b/src/mango/src/mango_idx.erl index a20d730a2..9ce1ef93c 100644 --- a/src/mango/src/mango_idx.erl +++ b/src/mango/src/mango_idx.erl @@ -176,11 +176,14 @@ from_ddoc(Db, {Props}) -> end, IdxMods = case dreyfus:available() of - true -> - [mango_idx_view, mango_idx_text]; - false -> - [mango_idx_view] - end, + true -> [mango_idx_text]; + false -> [] + end ++ + case nouveau:enabled() of + true -> [mango_idx_nouveau]; + false -> [] + end ++ + [mango_idx_view], Idxs = lists:flatmap(fun(Mod) -> Mod:from_ddoc({Props}) end, IdxMods), lists:map( fun(Idx) -> @@ -249,6 +252,13 @@ cursor_mod(#idx{type = <<"json">>}) -> mango_cursor_view; cursor_mod(#idx{def = all_docs, type = <<"special">>}) -> mango_cursor_special; +cursor_mod(#idx{type = <<"nouveau">>}) -> + case nouveau:enabled() of + true -> + mango_cursor_nouveau; + false -> + ?MANGO_ERROR({index_service_unavailable, <<"nouveau">>}) + end; cursor_mod(#idx{type = <<"text">>}) -> case dreyfus:available() of true -> @@ -261,6 +271,13 @@ idx_mod(#idx{type = <<"json">>}) -> mango_idx_view; idx_mod(#idx{type = <<"special">>}) -> mango_idx_special; +idx_mod(#idx{type = <<"nouveau">>}) -> + case nouveau:enabled() of + true -> + mango_idx_nouveau; + false -> + ?MANGO_ERROR({index_service_unavailable, <<"nouveau">>}) + end; idx_mod(#idx{type = <<"text">>}) -> case dreyfus:available() of true -> @@ -288,6 +305,13 @@ get_idx_type(Opts) -> case proplists:get_value(type, Opts) of <<"json">> -> <<"json">>; + <<"nouveau">> -> + case nouveau:enabled() of + true -> + <<"nouveau">>; + false -> + ?MANGO_ERROR({index_service_unavailable, <<"nouveau">>}) + end; <<"text">> -> case dreyfus:available() of true -> |