本文整理汇总了Python中MaKaC.common.indexes.IndexesHolder.clear方法的典型用法代码示例。如果您正苦于以下问题:Python IndexesHolder.clear方法的具体用法?Python IndexesHolder.clear怎么用?Python IndexesHolder.clear使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MaKaC.common.indexes.IndexesHolder
的用法示例。
在下文中一共展示了IndexesHolder.clear方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: reindexCategoryNameAndConferenceTitle
# 需要导入模块: from MaKaC.common.indexes import IndexesHolder [as 别名]
# 或者: from MaKaC.common.indexes.IndexesHolder import clear [as 别名]
def reindexCategoryNameAndConferenceTitle(dbi, withRBDB, prevVersion):
"""
Indexing Conference Title with new WhooshTextIndex
"""
IndexesHolder().removeById('conferenceTitle')
IndexesHolder().removeById('categoryName')
confTitleIdx = IndexesHolder().getIndex('conferenceTitle')
categNameIdx = IndexesHolder().getIndex('categoryName')
dbi.commit()
confTitleIdx.clear()
confTitleIdx.initialize(dbi, ConferenceHolder().itervalues())
categNameIdx.clear()
categNameIdx.initialize(dbi, CategoryManager().itervalues())
示例2: reindexCategoryNameAndConferenceTitle
# 需要导入模块: from MaKaC.common.indexes import IndexesHolder [as 别名]
# 或者: from MaKaC.common.indexes.IndexesHolder import clear [as 别名]
def reindexCategoryNameAndConferenceTitle(dbi, prevVersion):
"""
Indexing Conference Title with new WhooshTextIndex
"""
IndexesHolder().removeById('conferenceTitle')
IndexesHolder().removeById('categoryName')
confTitleIdx = IndexesHolder().getIndex('conferenceTitle')
categNameIdx = IndexesHolder().getIndex('categoryName')
dbi.commit()
iterator = (x[1] for x in console.conferenceHolderIterator(ConferenceHolder(), deepness='event'))
confTitleIdx.clear()
confTitleIdx.initialize(dbi, iterator)
categNameIdx.clear()
categNameIdx.initialize(dbi, CategoryManager().itervalues())