rather than add a new couch view why don't you use this one https://github.com/dimagi/commcare-hq/blob/master/corehq/apps/hqcase/_design/views/by_domain_external_id/map.js (additional note below)