-
Notifications
You must be signed in to change notification settings - Fork 12
Introduce dreyfus into couchdb
Chang Hua Guo edited this page Jan 18, 2017
·
3 revisions
git clone https://github.com/cloudant/couchdb.git
cd couchdb
git checkout 45918-pluggable-storage-engines
DepDescs = [
...
{dreyfus, "dreyfus", "master"},
...
MakeDep = fun
...
({AppName, RepoName, Version}) when AppName == dreyfus ->
Url = "https://github.com/cloudant-labs/" ++ RepoName ++ ".git",
{AppName, ".*", {git, Url, Version}};
...
end,
./configure --disable-fauxton --disable-docs
a. add dreyfus_epi plugin to couch_epi.config under rel/apps/ directory
{plugins, [
couch_db_epi,
chttpd_epi,
couch_index_epi,
dreyfus_epi,
global_changes_epi,
mango_epi,
mem3_epi,
setup_epi
]}.
b. add dreyfus
to reltool.config
under rel
directory
{sys, [
{rel, "couchdb", "2.0.0a", [
...
couch_peruser,
ddoc_cache,
dreyfus,
ets_lru,
...
]},
%% couchdb
{app, couch_peruser, [{incl_cond, include}]},
{app, ddoc_cache, [{incl_cond, include}]},
{app, dreyfus, [{incl_cond, include}]},
{app, ets_lru, [{incl_cond, include}]},
]}
c. download dreyfus.js
to share/server/dreyfus.js
curl https://raw.githubusercontent.com/cloudant/couchdb/c323f194328822385aa1bb2ab15b927cc604c4b7/share/server/dreyfus.js > share/server/dreyfus.js
d. modify file support/build_js.escript
main([]) ->
JsFiles = [...
"share/server/dreyfus.js",
"share/server/loop.js"],
CoffeeFiles = [...
"share/server/dreyfus.js",
"share/server/coffee-script.js",
"share/server/loop.js"],
e. add the exposed functions to share/server/loop.js
to be able to call them in a view
function init_sandbox() {
try {
...
sandbox.index = Dreyfus.index;
} catch (e) {
//log(e.toSource());
}
};
var Loop = function() {
var line, cmd, cmdkey, dispatch = {
...
"index_doc": Dreyfus.indexDoc
};
f. talking To Clouseau
add lines in rel/overlay/etc/local.ini
and rel/overlay/etc/default.ini
[dreyfus]
name = {{clouseau_name}}
g. modify file dev/run
"cluster_port": cluster_port,
"backend_port": backend_port,
"fauxton_root": fauxton_root,
"clouseau_name": "clouseau%[email protected]" % (idx+1),
"uuid": "fake_uuid_for_dev"
make
dev/run --admin=foo:bar
git clone https://github.com/cloudant-labs/clouseau
cd clouseau
mvn scala:run -Dlauncher=clouseau1
Feel free to follow our tuturials for search: https://cloudant.com/for-developers/search/ and https://cloudant.com/blog/search-faceting-from-scratch–2. There is also video tutorial available at https://www.youtube.com/watch?v=IdiCmKINL9g.