Example #1
0
def to_painless(self, schema):
    if not self.terms:
        return TRUE.to_painless()
    else:
        return Painless(miss=FALSE,
                        type=BOOLEAN,
                        expr=" && ".join("(" + t.to_painless(schema).expr + ")"
                                         for t in self.terms),
                        frum=self)
Example #2
0
def to_painless(self, schema):
    value = self.term.to_painless(schema)
    if value.expr or value.i:
        return TRUE.to_painless(schema)
    else:
        return Painless(miss=FALSE,
                        type=BOOLEAN,
                        expr="(" + value.expr +
                        ") instanceof java.lang.Double",
                        frum=self)