Commit 7ea3181a authored by Jonas Waeber's avatar Jonas Waeber
Browse files

Update missing format list.

parent 62d9f438
This diff is collapsed.
......@@ -3,7 +3,7 @@ import json
from simple_elastic import ElasticIndex
if __name__ == '__main__':
index = ElasticIndex('import-process-reports', url='http://localhost:8080')
index = ElasticIndex('import-process-reports-v2', url='http://localhost:8080')
query = {
"query": {
......@@ -19,7 +19,7 @@ if __name__ == '__main__':
{
"term": {
"report.status.keyword": {
"value": "FAILURE"
"value": "WARNING"
}
}
}
......@@ -57,6 +57,14 @@ if __name__ == '__main__':
new_set = set()
new_set.add(genre)
current_dict['genre'] = new_set
elif m.startswith('Could not map the following carrier type value:'):
carrier = m.replace('Could not map the following carrier type value: ', '').strip('.').strip()
if 'carrier' in current_dict:
current_dict['carrier'].add(carrier)
else:
new_set = set()
new_set.add(carrier)
current_dict['carrier'] = new_set
else:
print(m)
......@@ -64,7 +72,8 @@ if __name__ == '__main__':
for key in result_dict:
result_list_dict[key] = {
'genre': sorted(list(result_dict[key]['genre']) if 'genre' in result_dict[key] else []),
'language': sorted(list(result_dict[key]['language']) if 'language' in result_dict[key] else [])
'language': sorted(list(result_dict[key]['language']) if 'language' in result_dict[key] else []),
'carrier': sorted(list(result_dict[key]['carrier']) if 'carrier' in result_dict[key] else [])
}
with open('output.json', 'w') as fp:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment