_attr = getattr(cls, _cls.name)
_filters.append(cast(_attr, String).match(query))
result = session.query(cls)
result = result.filter(or_(*_filters))
subclasses = set()
for child in cls.__subclasses__():
    if child not in subclasses:
        subclasses.add(child)
result = result.outerjoin(child)
result = subclass.get_all(session, result)
return result
SQLAlchemy inheritance filter on all columns