If I'm reading this correctly you're using `(str tenant "path")` as the doc type. Works right now since the tenant is empty but as soon as it's not you'll end up with a new doc type without the custom mapping.

Could the tenant be a field in the elasticsearch document instead? `not_analyzed` as well since it's going to be used for filtering paths.