mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-05 08:53:14 +00:00
update file and wiki index (#7220)
This commit is contained in:
@@ -655,6 +655,11 @@ def get_seafes_env():
|
|||||||
return env
|
return env
|
||||||
|
|
||||||
def update_search_index():
|
def update_search_index():
|
||||||
|
update_file_search_index()
|
||||||
|
update_wiki_search_index()
|
||||||
|
|
||||||
|
|
||||||
|
def update_file_search_index():
|
||||||
argv = [
|
argv = [
|
||||||
Utils.get_python_executable(),
|
Utils.get_python_executable(),
|
||||||
'-m', 'seafes.indexes.repo_file.index_local',
|
'-m', 'seafes.indexes.repo_file.index_local',
|
||||||
@@ -662,10 +667,24 @@ def update_search_index():
|
|||||||
'update',
|
'update',
|
||||||
]
|
]
|
||||||
|
|
||||||
Utils.info('\nUpdating search index, this may take a while...\n')
|
Utils.info('\nUpdating file index, this may take a while...\n')
|
||||||
|
|
||||||
Utils.run_argv(argv, env=get_seafes_env())
|
Utils.run_argv(argv, env=get_seafes_env())
|
||||||
|
|
||||||
|
|
||||||
|
def update_wiki_search_index():
|
||||||
|
argv = [
|
||||||
|
Utils.get_python_executable(),
|
||||||
|
'-m', 'seafes.indexes.wiki.index_wiki_local',
|
||||||
|
'--loglevel', 'debug',
|
||||||
|
'update',
|
||||||
|
]
|
||||||
|
|
||||||
|
Utils.info('\nUpdating wiki index, this may take a while...\n')
|
||||||
|
|
||||||
|
Utils.run_argv(argv, env=get_seafes_env())
|
||||||
|
|
||||||
|
|
||||||
def delete_search_index():
|
def delete_search_index():
|
||||||
choice = None
|
choice = None
|
||||||
while choice not in ('y', 'n', ''):
|
while choice not in ('y', 'n', ''):
|
||||||
@@ -675,6 +694,11 @@ def delete_search_index():
|
|||||||
if choice == 'n':
|
if choice == 'n':
|
||||||
return
|
return
|
||||||
|
|
||||||
|
delete_file_search_index()
|
||||||
|
delete_wiki_search_index()
|
||||||
|
|
||||||
|
|
||||||
|
def delete_file_search_index():
|
||||||
argv = [
|
argv = [
|
||||||
Utils.get_python_executable(),
|
Utils.get_python_executable(),
|
||||||
'-m', 'seafes.indexes.repo_file.index_local',
|
'-m', 'seafes.indexes.repo_file.index_local',
|
||||||
@@ -682,7 +706,20 @@ def delete_search_index():
|
|||||||
'clear',
|
'clear',
|
||||||
]
|
]
|
||||||
|
|
||||||
Utils.info('\nDelete search index, this may take a while...\n')
|
Utils.info('\nDelete file index, this may take a while...\n')
|
||||||
|
|
||||||
|
Utils.run_argv(argv, env=get_seafes_env())
|
||||||
|
|
||||||
|
|
||||||
|
def delete_wiki_search_index():
|
||||||
|
argv = [
|
||||||
|
Utils.get_python_executable(),
|
||||||
|
'-m', 'seafes.indexes.wiki.index_wiki_local',
|
||||||
|
'--loglevel', 'debug',
|
||||||
|
'clear',
|
||||||
|
]
|
||||||
|
|
||||||
|
Utils.info('\nDelete wiki index, this may take a while...\n')
|
||||||
|
|
||||||
Utils.run_argv(argv, env=get_seafes_env())
|
Utils.run_argv(argv, env=get_seafes_env())
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user