elasticsearch: use isinstance() instead of type() == klass