本文整理汇总了Python中meresco.lucene.fieldregistry.FieldRegistry.rangeQueryAndType方法的典型用法代码示例。如果您正苦于以下问题:Python FieldRegistry.rangeQueryAndType方法的具体用法?Python FieldRegistry.rangeQueryAndType怎么用?Python FieldRegistry.rangeQueryAndType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类meresco.lucene.fieldregistry.FieldRegistry
的用法示例。
在下文中一共展示了FieldRegistry.rangeQueryAndType方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testRangeQueryAndType
# 需要导入模块: from meresco.lucene.fieldregistry import FieldRegistry [as 别名]
# 或者: from meresco.lucene.fieldregistry.FieldRegistry import rangeQueryAndType [as 别名]
def testRangeQueryAndType(self):
registry = FieldRegistry()
registry.register("longfield", fieldDefinition=LONGFIELD)
registry.register("intfield", fieldDefinition=INTFIELD)
q, t = registry.rangeQueryAndType('longfield')
self.assertEqual("Long", q)
self.assertEqual(long, t)
q, t = registry.rangeQueryAndType('intfield')
self.assertEqual("Int", q)
self.assertEqual(int, t)
q, t = registry.rangeQueryAndType('range.double.field')
self.assertEqual("Double", q)
self.assertEqual(float, t)
q, t = registry.rangeQueryAndType('anyfield')
self.assertEqual("String", q)
self.assertEqual(str, t)