-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat/seasearch add wiki search sup #366
base: master
Are you sure you want to change the base?
Conversation
09f88bf
to
9f1909d
Compare
254f4eb
to
444663d
Compare
@@ -159,6 +159,8 @@ def search_files(self, repos, keyword, start=0, size=10, suffixes=None, search_p | |||
bulk_search_params.append(data) | |||
search_path = None | |||
|
|||
|
|||
logger.debug('search in repo_filename_index params: %s', json.dumps(bulk_search_params)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个去掉
wiki_index.delete_index_by_index_name(wiki_index_name) | ||
wiki_status_index.delete_documents_by_repo(wiki_id) | ||
|
||
def keyword_search(self, query, repos, repo_filename_index, count, suffixes=None): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
上面有一个 keyword_search 了
}, | ||
'content': { | ||
'type': 'text', | ||
'highlightable': True, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
highlightable需要吗?seafes 和 seasearch中之前的内容搜索都没有
seasearch/index_store/wiki_index.py
Outdated
def check_index(self, index_name): | ||
return self.seasearch_api.check_index_mapping(index_name).get('is_exist') | ||
|
||
def query_data_by_doc_uuid(self, index_name, doc_uuids_list, start, size): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
改成 query_data_by_doc_uuids
|
||
|
||
SEASEARCH_WIKI_BULK_OPETATE_LIMIT = 25 | ||
SEASEARCH_WIKI_QUERY_DOC_UUID_STEP = 10 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里的数值设置的太小了吧
seasearch/utils/constants.py
Outdated
WIKI_INDEX_PREFIX = 'wiki_' | ||
|
||
SEASEARCH_QUERY_DOC_UUID_STEP = 20 | ||
SEASEARCH_BULK_OPETATE_LIMIT = 25 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这两个常量没用吧
seasearch/utils/__init__.py
Outdated
@@ -99,3 +100,26 @@ def need_index_metadata_info(repo_id, session): | |||
return False | |||
|
|||
return True | |||
|
|||
|
|||
def is_wiki(path): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个命名改一下吧,这里是判断是否是的wiki中的文件,不是这个文件是不是wiki
seasearch/index_store/wiki_index.py
Outdated
doc_uuids = [page['docUuid'] for page in config['pages'] if page['id'] in navigation_ids] | ||
return doc_uuids | ||
|
||
def extract_deleted_doc_uuids(self, config): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个和上面的extract_doc_uuids 是不是可以放到一个方法里面处理,更合适?
seasearch/index_store/wiki_index.py
Outdated
def get_wiki_conf(self, wiki_id): | ||
# Get wiki config dict | ||
conf_path = posixpath.join(WIKI_CONFIG_PATH, WIKI_CONFIG_FILE_NAME) | ||
conf_id = seafile_api.get_file_id_by_path(wiki_id, conf_path) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里不应该叫conf_id吧
|
||
if wiki_status.need_recovery(): | ||
logger.warning('%s: wiki index inrecovery', wiki_id) | ||
wiki_index.update(index_name, wiki_id, commit_id, to_commit) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
按照现在的逻辑这里还能正常recovery吗?
@@ -35,9 +39,6 @@ class RepoStatusIndex(object): | |||
'updatingto': { | |||
'type': 'keyword' | |||
}, | |||
'metadata_updated_time': { | |||
'type': 'keyword' | |||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里把之前加的属性给删了,别的功能无法工作了
45d4832
to
08447c9
Compare
08447c9
to
7e21984
Compare
No description provided.