当前位置: 首页>>代码示例>>Python>>正文


Python ComposedQuery.addDrilldownQuery方法代码示例

本文整理汇总了Python中meresco.lucene.composedquery.ComposedQuery.addDrilldownQuery方法的典型用法代码示例。如果您正苦于以下问题:Python ComposedQuery.addDrilldownQuery方法的具体用法?Python ComposedQuery.addDrilldownQuery怎么用?Python ComposedQuery.addDrilldownQuery使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在meresco.lucene.composedquery.ComposedQuery的用法示例。


在下文中一共展示了ComposedQuery.addDrilldownQuery方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: testAddDrilldownQuery

# 需要导入模块: from meresco.lucene.composedquery import ComposedQuery [as 别名]
# 或者: from meresco.lucene.composedquery.ComposedQuery import addDrilldownQuery [as 别名]
 def testAddDrilldownQuery(self):
     cq = ComposedQuery('coreA')
     cq.addDrilldownQuery('coreB', ('field', ['value']))
     self.assertValidateRaisesValueError(cq, "No match set for cores ('coreA', 'coreB')")
     cq.addMatch(dict(core='coreA', uniqueKey='kA'), dict(core='coreB', key='kB'))
     self.assertEquals([('field', ['value'])], cq.drilldownQueriesFor('coreB'))
     cq.convertWith(coreB=lambda q: "converted_" + q)
     self.assertEquals([('field', ['value'])], cq.drilldownQueriesFor('coreB'))
开发者ID:FashtimeDotCom,项目名称:meresco-lucene,代码行数:10,代码来源:composedquerytest.py

示例2: testAddFilterQueryAfterConversion

# 需要导入模块: from meresco.lucene.composedquery import ComposedQuery [as 别名]
# 或者: from meresco.lucene.composedquery.ComposedQuery import addDrilldownQuery [as 别名]
 def testAddFilterQueryAfterConversion(self):
     cq = ComposedQuery('coreA')
     cq.setCoreQuery('coreA', query='A')
     cq.convertWith(coreA=lambda q: "converted_" + q)
     self.assertEquals('converted_A', cq.queryFor('coreA'))
     # Assert the following does not raise KeyError
     cq.addFilterQuery('coreA', 'field=value')
     cq.addFacet('coreA', 'F0')
     cq.addDrilldownQuery('coreA', 'drilldownQuery')
     cq.addOtherCoreFacetFilter('coreA', 'q')
开发者ID:FashtimeDotCom,项目名称:meresco-lucene,代码行数:12,代码来源:composedquerytest.py

示例3: testJoinFacetWithJoinDrilldownQueryFilters

# 需要导入模块: from meresco.lucene.composedquery import ComposedQuery [as 别名]
# 或者: from meresco.lucene.composedquery.ComposedQuery import addDrilldownQuery [as 别名]
 def testJoinFacetWithJoinDrilldownQueryFilters(self):
     q = ComposedQuery('coreA', query=luceneQueryFromCql('M=true'))
     q.addDrilldownQuery('coreB', drilldownQuery=('cat_O', ['true']))
     q.addFacet('coreB', dict(fieldname='cat_O', maxTerms=10))
     q.addMatch(dict(core='coreA', uniqueKey=KEY_PREFIX + 'A'), dict(core='coreB', key=KEY_PREFIX + 'B'))
     result = returnValueFromGenerator(self.dna.any.executeComposedQuery(query=q))
     self.assertEquals(2, result.total)
     self.assertEquals([{
             'terms': [
                 {'count': 3, 'term': u'true'},
             ],
             'path': [],
             'fieldname': u'cat_O'
         }], result.drilldownData)
开发者ID:jerryba,项目名称:meresco-lucene,代码行数:16,代码来源:multilucenetest.py

示例4: testJoinDrilldownQueryFilters

# 需要导入模块: from meresco.lucene.composedquery import ComposedQuery [as 别名]
# 或者: from meresco.lucene.composedquery.ComposedQuery import addDrilldownQuery [as 别名]
 def testJoinDrilldownQueryFilters(self):
     q = ComposedQuery('coreA', query=luceneQueryFromCql('M=true'))
     q.addDrilldownQuery('coreB', drilldownQuery=('cat_O', ['true']))
     q.addMatch(dict(core='coreA', uniqueKey=KEY_PREFIX + 'A'), dict(core='coreB', key=KEY_PREFIX + 'B'))
     result = returnValueFromGenerator(self.dna.any.executeComposedQuery(query=q))
     self.assertEquals(2, result.total)
开发者ID:jerryba,项目名称:meresco-lucene,代码行数:8,代码来源:multilucenetest.py


注:本文中的meresco.lucene.composedquery.ComposedQuery.addDrilldownQuery方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。