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