new fxns 2 interact with elasticsearch, and couchdb views