From 94c3d7d2e23970429ae4e232642b6463c0ca6f59 Mon Sep 17 00:00:00 2001 From: midoks Date: Tue, 20 Aug 2019 18:32:30 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/solr/index.py | 16 + plugins/solr/tpl/db-data-config.xml | 22 + plugins/solr/tpl/managed-schema | 635 ++++++++++++++++++++++++++++ plugins/solr/tpl/solrconfig.xml | 6 + 4 files changed, 679 insertions(+) create mode 100644 plugins/solr/tpl/db-data-config.xml create mode 100644 plugins/solr/tpl/managed-schema diff --git a/plugins/solr/index.py b/plugins/solr/index.py index a11dcaba2..804425a0f 100755 --- a/plugins/solr/index.py +++ b/plugins/solr/index.py @@ -222,6 +222,22 @@ def addCollection(): retdata = runShell(solr_bin + ' create -c ' + name) if retdata[1] != "": return public.returnJson(False, '添加失败!:' + retdata[1]) + + sc_path = getServerDir() + "/server/solr/" + name + "/conf/solrconfig.xml" + sc_path_tpl = getPluginDir() + "/tpl/solrconfig.xml" + content = public.readFile(sc_path_tpl) + public.writeFile(sc_path, content) + + sd_path = getServerDir() + "/server/solr/" + name + "/conf/db-data-config.xml" + sd_path_tpl = getPluginDir() + "/tpl/db-data-config.xml" + content = public.readFile(sd_path_tpl) + public.writeFile(sd_path, content) + + sd_path = getServerDir() + "/server/solr/" + name + "/conf/managed-schema" + sd_path_tpl = getPluginDir() + "/tpl/managed-schema" + content = public.readFile(sd_path_tpl) + public.writeFile(sd_path, content) + return public.returnJson(True, '添加成功!:' + retdata[0]) diff --git a/plugins/solr/tpl/db-data-config.xml b/plugins/solr/tpl/db-data-config.xml new file mode 100644 index 000000000..b4b4211b4 --- /dev/null +++ b/plugins/solr/tpl/db-data-config.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/plugins/solr/tpl/managed-schema b/plugins/solr/tpl/managed-schema new file mode 100644 index 000000000..c0a31e57a --- /dev/null +++ b/plugins/solr/tpl/managed-schema @@ -0,0 +1,635 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + id + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/plugins/solr/tpl/solrconfig.xml b/plugins/solr/tpl/solrconfig.xml index 4e845d9aa..e832f8bda 100644 --- a/plugins/solr/tpl/solrconfig.xml +++ b/plugins/solr/tpl/solrconfig.xml @@ -98,6 +98,12 @@ + + + db-data-config.xml + + +