本文整理汇总了Python中bhsearch.api.BloodhoundSearchApi.change_doc_id方法的典型用法代码示例。如果您正苦于以下问题:Python BloodhoundSearchApi.change_doc_id方法的具体用法?Python BloodhoundSearchApi.change_doc_id怎么用?Python BloodhoundSearchApi.change_doc_id使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类bhsearch.api.BloodhoundSearchApi
的用法示例。
在下文中一共展示了BloodhoundSearchApi.change_doc_id方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: wiki_page_renamed
# 需要导入模块: from bhsearch.api import BloodhoundSearchApi [as 别名]
# 或者: from bhsearch.api.BloodhoundSearchApi import change_doc_id [as 别名]
def wiki_page_renamed(self, page, old_name):
"""Called when a page has been renamed."""
try:
doc = self.build_doc(page)
search_api = BloodhoundSearchApi(self.env)
search_api.change_doc_id(doc, old_name)
except Exception, e:
if self.silence_on_error:
self.log.error("Error occurs during renaming wiki from %s \
to %s. The error will not be propagated. Exception: %s",
old_name, page.name, e)
else:
raise
示例2: _rename_milestone
# 需要导入模块: from bhsearch.api import BloodhoundSearchApi [as 别名]
# 或者: from bhsearch.api.BloodhoundSearchApi import change_doc_id [as 别名]
def _rename_milestone(self, milestone, old_name):
try:
doc = self.build_doc(milestone)
search_api = BloodhoundSearchApi(self.env)
with search_api.start_operation() as operation_context:
search_api.change_doc_id(doc, old_name, operation_context)
TicketIndexer(self.env).reindex_tickets(
search_api, operation_context, milestone=milestone.name)
except Exception, e:
if self.silence_on_error:
self.log.error("Error occurs during renaming milestone from \
%s to %s. The error will not be propagated. Exception: %s",
old_name, milestone.name, e)
else:
raise