Esempio n. 1
0
 def convert(self, cql, shouldModifyFieldValue, valueModifier=None, fieldnameModifier=None):
     converter = CqlMultiSearchClauseConversion([
         SearchTermFilterAndModifier(
             shouldModifyFieldValue=shouldModifyFieldValue,
             valueModifier=valueModifier,
             fieldnameModifier=fieldnameModifier).filterAndModifier(),
         ], fromKwarg="aKwarg")
     return converter._convert(cqlToExpression(cql))
 def convert(self, cqlString):
     converter = CqlMultiSearchClauseConversion(
         [
             RenameFieldForExact(
                 ['untokenized.field', 'untokenized.prefix.*'],
                 'untokenized.').filterAndModifier()
         ],
         fromKwarg="cqlAbstractSyntaxTree")
     return converter._convert(cqlToExpression(cqlString))
 def convert(self, cql, shouldModifyFieldValue, valueModifier=None, fieldnameModifier=None):
     converter = CqlMultiSearchClauseConversion(
         [
             SearchTermFilterAndModifier(
                 shouldModifyFieldValue=shouldModifyFieldValue,
                 valueModifier=valueModifier,
                 fieldnameModifier=fieldnameModifier,
             ).filterAndModifier()
         ],
         fromKwarg="aKwarg",
     )
     return converter._convert(cqlToExpression(cql))
Esempio n. 4
0
 def testNestedWithReplaced(self):
     q = cqlToExpression('A')
     def canModify1(expression):
         return expression.term == 'A'
     def modify1(expression):
         expression.replaceWith(cqlToExpression('aa OR bb'))
     def canModify2(expression):
         return expression.term == 'bb'
     def modify2(expression):
         expression.term = 'B'
     conversion = CqlMultiSearchClauseConversion([
                 (canModify1, modify1),
                 (canModify2, modify2),
             ], fromKwarg="thisQuery")
     result = conversion._convert(q)
     self.assertEqual(cqlToExpression('aa OR B'), result)
 def testNestedWithReplaced(self):
     q = cqlToExpression('A')
     def canModify1(expression):
         return expression.term == 'A'
     def modify1(expression):
         expression.replaceWith(cqlToExpression('aa OR bb'))
     def canModify2(expression):
         return expression.term == 'bb'
     def modify2(expression):
         expression.term = 'B'
     conversion = CqlMultiSearchClauseConversion([
                 (canModify1, modify1),
                 (canModify2, modify2),
             ], fromKwarg="thisQuery")
     result = conversion._convert(q)
     self.assertEqual(cqlToExpression('aa OR B'), result)
 def convert(self, cqlString):
     converter = CqlMultiSearchClauseConversion([
         RewriteBoundingBoxFields().filterAndModifier()
     ], fromKwarg="query")
     query = cqlToExpression(cqlString)
     return converter._convert(query=query)
Esempio n. 7
0
 def convert(self, cqlString):
     converter = CqlMultiSearchClauseConversion([
             RenameFieldForExact(['untokenized.field', 'untokenized.prefix.*'], 'untokenized.').filterAndModifier()
         ], fromKwarg="cqlAbstractSyntaxTree")
     return converter._convert(cqlToExpression(cqlString))