fixes bug

This commit is contained in:
2023-10-09 09:52:08 +02:00
parent 1122a378c8
commit 463535f537
+17 -17
View File
@@ -71,12 +71,18 @@ def get_stat_persons():
if any(c in '()!%&/+/,;.' for c in surname):
continue
# check requirements for following analysis
if firstname == "" or surname == "":
es.index(index=index_name, id=lsf_id, document=current_person)
continue
if name in all_names:
continue
else:
all_names.append(name)
current_person["name"] = name
current_person["show_name"] = firstname + " " + surname
current_person["surname"] = surname
current_person["firstname"] = firstname
current_person["lsf_id"] = lsf_id
@@ -121,11 +127,6 @@ def get_stat_persons():
}
current_person["ude_publication_hits_last_year"] = es.search(index="due_index_1.0", query=query, size=0).get("hits").get("total").get("value")
# check requirements for following analysis
if firstname == "" or surname == "":
es.index(index=index_name, id=lsf_id, document=current_person)
continue
# akutell
query = {
"multi_match": {
@@ -236,9 +237,8 @@ def get_stat_persons():
}
},
{
"query_string": {
"default_field": "Affiliation",
"query": "University of Duisburg Essen"
"match_phrase": {
"Affiliation": "University of Duisburg Essen"
}
}
],
@@ -371,7 +371,7 @@ def get_best_10():
best_10_ude_publication_hits = {}
counter = 1
for hit in hits:
best_10_ude_publication_hits[str(counter)] = {"name": hit.get("_source").get("name"), "number": hit.get("sort")[0]}
best_10_ude_publication_hits[str(counter)] = {"name": hit.get("_source").get("show_name"), "number": hit.get("sort")[0]}
counter += 1
best_10["best_10_ude_publication_hits"] = best_10_ude_publication_hits
@@ -385,7 +385,7 @@ def get_best_10():
best_10_akutell_hits = {}
counter = 1
for hit in hits:
best_10_akutell_hits[str(counter)] = {"name": hit.get("_source").get("name"), "number": hit.get("sort")[0]}
best_10_akutell_hits[str(counter)] = {"name": hit.get("_source").get("show_name"), "number": hit.get("sort")[0]}
counter += 1
best_10["best_10_akutell_hits"] = best_10_akutell_hits
@@ -399,7 +399,7 @@ def get_best_10():
best_10_projects_dfg_hits = {}
counter = 1
for hit in hits:
best_10_projects_dfg_hits[str(counter)] = {"name": hit.get("_source").get("name"), "number": hit.get("sort")[0]}
best_10_projects_dfg_hits[str(counter)] = {"name": hit.get("_source").get("show_name"), "number": hit.get("sort")[0]}
counter += 1
best_10["best_10_projects_dfg_hits"] = best_10_projects_dfg_hits
@@ -427,7 +427,7 @@ def get_best_10():
best_10_wos_publication_hits = {}
counter = 1
for hit in hits:
best_10_wos_publication_hits[str(counter)] = {"name": hit.get("_source").get("name"), "number": hit.get("sort")[0]}
best_10_wos_publication_hits[str(counter)] = {"name": hit.get("_source").get("show_name"), "number": hit.get("sort")[0]}
counter += 1
best_10["best_10_wos_publication_hits"] = best_10_wos_publication_hits
@@ -441,7 +441,7 @@ def get_best_10():
best_10_patent_hits = {}
counter = 1
for hit in hits:
best_10_patent_hits[str(counter)] = {"name": hit.get("_source").get("name"), "number": hit.get("sort")[0]}
best_10_patent_hits[str(counter)] = {"name": hit.get("_source").get("show_name"), "number": hit.get("sort")[0]}
counter += 1
best_10["best_10_patent_hits"] = best_10_patent_hits
@@ -456,7 +456,7 @@ def get_best_10():
best_10_ude_publication_hits_last_year = {}
counter = 1
for hit in hits:
best_10_ude_publication_hits_last_year[str(counter)] = {"name": hit.get("_source").get("name"), "number": hit.get("sort")[0]}
best_10_ude_publication_hits_last_year[str(counter)] = {"name": hit.get("_source").get("show_name"), "number": hit.get("sort")[0]}
counter += 1
best_10["best_10_ude_publication_hits_last_year"] = best_10_ude_publication_hits_last_year
@@ -470,7 +470,7 @@ def get_best_10():
best_10_akutell_hits_last_year = {}
counter = 1
for hit in hits:
best_10_akutell_hits_last_year[str(counter)] = {"name": hit.get("_source").get("name"), "number": hit.get("sort")[0]}
best_10_akutell_hits_last_year[str(counter)] = {"name": hit.get("_source").get("show_name"), "number": hit.get("sort")[0]}
counter += 1
best_10["best_10_akutell_hits_last_year"] = best_10_akutell_hits_last_year
@@ -484,7 +484,7 @@ def get_best_10():
best_10_wos_publication_hits_last_year = {}
counter = 1
for hit in hits:
best_10_wos_publication_hits_last_year[str(counter)] = {"name": hit.get("_source").get("name"), "number": hit.get("sort")[0]}
best_10_wos_publication_hits_last_year[str(counter)] = {"name": hit.get("_source").get("show_name"), "number": hit.get("sort")[0]}
counter += 1
best_10["best_10_wos_publication_hits_last_year"] = best_10_wos_publication_hits_last_year
@@ -498,7 +498,7 @@ def get_best_10():
best_10_patent_hits_last_year = {}
counter = 1
for hit in hits:
best_10_patent_hits_last_year[str(counter)] = {"name": hit.get("_source").get("name"), "number": hit.get("sort")[0]}
best_10_patent_hits_last_year[str(counter)] = {"name": hit.get("_source").get("show_name"), "number": hit.get("sort")[0]}
counter += 1
best_10["best_10_patent_hits_last_year"] = best_10_patent_hits_last_year