Skip to content
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

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

cir9no
Copy link
Contributor

@cir9no cir9no commented Aug 18, 2024

No description provided.

@cir9no cir9no force-pushed the feat/seasearch-add-wiki-search-sup branch from 09f88bf to 9f1909d Compare August 26, 2024 07:34
@cir9no cir9no force-pushed the feat/seasearch-add-wiki-search-sup branch from 254f4eb to 444663d Compare September 25, 2024 07:16
@@ -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))
Copy link
Contributor

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):
Copy link
Contributor

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,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

highlightable需要吗?seafes 和 seasearch中之前的内容搜索都没有

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):
Copy link
Contributor

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里的数值设置的太小了吧

WIKI_INDEX_PREFIX = 'wiki_'

SEASEARCH_QUERY_DOC_UUID_STEP = 20
SEASEARCH_BULK_OPETATE_LIMIT = 25
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这两个常量没用吧

@@ -99,3 +100,26 @@ def need_index_metadata_info(repo_id, session):
return False

return True


def is_wiki(path):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个命名改一下吧,这里是判断是否是的wiki中的文件,不是这个文件是不是wiki

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):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个和上面的extract_doc_uuids 是不是可以放到一个方法里面处理,更合适?

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)
Copy link
Contributor

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)
Copy link
Contributor

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'
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里把之前加的属性给删了,别的功能无法工作了

@cir9no cir9no force-pushed the feat/seasearch-add-wiki-search-sup branch 2 times, most recently from 45d4832 to 08447c9 Compare October 14, 2024 07:21
@cir9no cir9no force-pushed the feat/seasearch-add-wiki-search-sup branch from 08447c9 to 7e21984 Compare October 16, 2024 02:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants