本文整理匯總了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)