From e6ea2737c0e5ebca8914e7d24e5af0210f7faf9d Mon Sep 17 00:00:00 2001 From: midoks Date: Tue, 6 Aug 2019 21:21:41 +0800 Subject: [PATCH] up --- plugins/solr/index.html | 2 +- plugins/solr/index.py | 9 +++++++-- plugins/solr/js/solr.js | 2 +- plugins/solr/script/full.py | 4 ++-- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/plugins/solr/index.html b/plugins/solr/index.html index ecb4ae9a9..6ed3a824d 100755 --- a/plugins/solr/index.html +++ b/plugins/solr/index.html @@ -5,7 +5,7 @@

自启动

管理

日志

-

全量同步脚本

+

全量分页脚本

说明

diff --git a/plugins/solr/index.py b/plugins/solr/index.py index a0bd8f16a..9a1d88e32 100755 --- a/plugins/solr/index.py +++ b/plugins/solr/index.py @@ -96,6 +96,12 @@ def initDreplace(): public.writeFile(file_bin, content) public.execShell('chmod +x ' + file_bin) + file_py = initD_path + '/' + getPluginName() + '.py' + if not os.path.exists(file_py): + content = public.readFile(getPluginDir() + '/script/full.py') + public.writeFile(file_py, content) + public.execShell('chmod +x ' + file_py) + return file_bin @@ -241,9 +247,8 @@ def confFileCollection(): return public.returnJson(True, 'OK', {'path': conf_file}) - def scriptFull(): - return getPluginDir() + "/script/full.py" + return getServerDir() + "/init.d/solr.py" # rsyncdReceive if __name__ == "__main__": diff --git a/plugins/solr/js/solr.js b/plugins/solr/js/solr.js index 4d90e2413..f05372c7c 100755 --- a/plugins/solr/js/solr.js +++ b/plugins/solr/js/solr.js @@ -169,7 +169,7 @@ function cmdCollection(name){ var cmd = '
'; cmd += ''; cmd += ''; - cmd += ''; + cmd += ''; cmd += ''; cmd += '
增量更新curl "http://127.0.0.1:8983/solr/'+name+'/dataimport?command=delta-import&wt=json&clean=false&commit=true"
全量更新curl "http://127.0.0.1:8983/solr/'+name+'/dataimport?command=full-import&wt=json&clean=false&commit=true"
全量分页更新curl "http://127.0.0.1:8983/solr/'+name+'/dataimport?command=full-import&wt=json&clean=false&commit=true&length=100&offset=0"
全量分页更新[计划任务]python /www/server/solr/init.d/solr.py
默认端口:8983(可修改),默认IP为本地,可修改。
'; diff --git a/plugins/solr/script/full.py b/plugins/solr/script/full.py index b0ad7efab..73486a66d 100755 --- a/plugins/solr/script/full.py +++ b/plugins/solr/script/full.py @@ -49,8 +49,8 @@ def execShell(cmdstring, cwd=None, timeout=None, shell=True): return sub.communicate() -for x in xrange(1, count / 10 + 1): +for x in xrange(1, count / 100 + 1): y = x * 10 - cmd = 'curl --basic -u admin:admin "http://127.0.0.1:8983/solr/sodht/dataimport?command=full-import&wt=json&clean=false&commit=true&length=10&offset=' + \ + cmd = 'curl --basic -u admin:admin "http://127.0.0.1:8983/solr/sodht/dataimport?command=full-import&wt=json&clean=false&commit=true&length=100&offset=' + \ str(y) + '"' print execShell(cmd)