diff --git a/service/src/main/inse/logic.py b/service/src/main/inse/logic.py index 1ca95754..42c32923 100644 --- a/service/src/main/inse/logic.py +++ b/service/src/main/inse/logic.py @@ -366,6 +366,14 @@ def search_persons_by_name(author_name: str, limit: Optional[int] = 10) -> model } } }, + { + "match_phrase_prefix": { + "display_name": { + "query": author_name, + "boost": 3 + } + } + }, { "match": { "display_name": { diff --git a/webapp/src/app/modules/person-list/person-list.component.html b/webapp/src/app/modules/person-list/person-list.component.html index 221648c9..820c062b 100644 --- a/webapp/src/app/modules/person-list/person-list.component.html +++ b/webapp/src/app/modules/person-list/person-list.component.html @@ -1,3 +1,7 @@ +@if (!isPersonsLoading && state.persons().length > 0) { +
{{ state.persons().length }} Ergebnisse
+} +{{ getDistinguishingId(person) }}
@if (person.affiliations!=undefined){
{{ person.affiliations[0]?.institution }}
diff --git a/webapp/src/app/modules/person-list/person-list.component.scss b/webapp/src/app/modules/person-list/person-list.component.scss
index e12337d7..10174b2e 100644
--- a/webapp/src/app/modules/person-list/person-list.component.scss
+++ b/webapp/src/app/modules/person-list/person-list.component.scss
@@ -1,3 +1,9 @@
+.result-count {
+ margin: 0 0 12px;
+ font-size: 14px;
+ color: #666;
+}
+
.person-card {
width: 100%;
height: 100%;
@@ -35,6 +41,12 @@
margin: 0;
}
+.person-id {
+ font-size: 11px;
+ color: #aaa;
+ margin: 0;
+}
+
.affiliation {
color: #666;
margin: 0;
diff --git a/webapp/src/app/modules/person-list/person-list.component.ts b/webapp/src/app/modules/person-list/person-list.component.ts
index 8a69628f..38469f7a 100644
--- a/webapp/src/app/modules/person-list/person-list.component.ts
+++ b/webapp/src/app/modules/person-list/person-list.component.ts
@@ -43,7 +43,7 @@ export class PersonListComponent implements OnInit{
this.personsService.searchPersonsByName(author_name).subscribe({
next: (result) => {
- this.state.persons.set(result.persons ?? []);
+ this.state.persons.set(this.sortByRanking(result.persons ?? []));
this.state.hasSearched.set(true);
this.isPersonsLoading = false
},
@@ -71,5 +71,65 @@ export class PersonListComponent implements OnInit{
console.log(id)
this.router.navigate(['/persons',id]);
}
-
+
+ sortByRanking(persons: Person[]): Person[] {
+ const personsByRank = new Map