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 + + +