本文整理汇总了Python中meresco.lucene.composedquery.ComposedQuery.keyName方法的典型用法代码示例。如果您正苦于以下问题:Python ComposedQuery.keyName方法的具体用法?Python ComposedQuery.keyName怎么用?Python ComposedQuery.keyName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类meresco.lucene.composedquery.ComposedQuery
的用法示例。
在下文中一共展示了ComposedQuery.keyName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testKeyNamesDifferPerCore
# 需要导入模块: from meresco.lucene.composedquery import ComposedQuery [as 别名]
# 或者: from meresco.lucene.composedquery.ComposedQuery import keyName [as 别名]
def testKeyNamesDifferPerCore(self):
cq = ComposedQuery('coreA')
cq.addMatch(dict(core='coreA', uniqueKey='keyA'), dict(core='coreB', key='keyB'))
cq.addMatch(dict(core='coreA', uniqueKey='keyAC'), dict(core='coreC', key='keyC'))
cq.addFacet(core='coreB', facet='F0')
cq.addFacet(core='coreC', facet='F1')
self.assertEquals('keyAC', cq.keyName('coreA', 'coreC'))
self.assertEquals('keyC', cq.keyName('coreC', 'coreA'))
self.assertEquals(set(['keyA', 'keyAC']), cq.keyNames('coreA'))
示例2: testKeyName
# 需要导入模块: from meresco.lucene.composedquery import ComposedQuery [as 别名]
# 或者: from meresco.lucene.composedquery.ComposedQuery import keyName [as 别名]
def testKeyName(self):
composedQuery = ComposedQuery('coreA')
composedQuery.setCoreQuery(core='coreA', query=None)
composedQuery.setCoreQuery(core='coreB', query=None)
composedQuery.addMatch(dict(core='coreA', uniqueKey='keyA'), dict(core='coreB', key='keyB'))
self.assertEquals('keyA', composedQuery.keyName('coreA'))
self.assertEquals('keyB', composedQuery.keyName('coreB'))