fleshed out query-data, connects to elasticsearch and couchbase and returns documents that the specified user has access to