def publish_report(user_id, search_data): """Create report for a search and send it by email""" query = es_utils.filter2query(json.loads(search_data['filter']), user_id=user_id) found = superdesk.app.data.elastic.es.search( body=query, index=es_utils.get_index()) docs = es_utils.get_docs(found) send_report_email(user_id, search_data, docs)
def publish_report(user_id, search_data): """Create report for a search and send it by email""" query = es_utils.filter2query(json.loads(search_data['filter']), user_id=user_id) found = superdesk.app.data.elastic.es.search(body=query, index=es_utils.get_index()) docs = es_utils.get_docs(found) send_report_email(user_id, search_data, docs)
def publish_report(user_id, search_data): """Create report for a search and send it by email""" search_filter = json.loads(search_data['filter']) query = es_utils.filter2query(search_filter, user_id=user_id) repos = es_utils.filter2repos(search_filter) types = es_utils.get_doc_types(repos) found = superdesk.app.data.elastic.es.search( body=query, index=es_utils.get_index(types), doc_type=types) docs = es_utils.get_docs(found) send_report_email(user_id, search_data, docs)