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 += '增量更新 | curl "http://127.0.0.1:8983/solr/'+name+'/dataimport?command=delta-import&wt=json&clean=false&commit=true" |
';
cmd += '全量更新 | curl "http://127.0.0.1:8983/solr/'+name+'/dataimport?command=full-import&wt=json&clean=false&commit=true" | |
';
- cmd += '全量分页更新 | curl "http://127.0.0.1:8983/solr/'+name+'/dataimport?command=full-import&wt=json&clean=false&commit=true&length=100&offset=0" | |
';
+ cmd += '全量分页更新[计划任务] | python /www/server/solr/init.d/solr.py | |
';
cmd += '默认端口:8983(可修改),默认IP为本地,可修改。 |
';
cmd += '
';
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)