From be87caf7f65cdf315d11316ac40c647174e8ac11 Mon Sep 17 00:00:00 2001
From: jonaswinkler <17569239+jonaswinkler@users.noreply.github.com>
Date: Sat, 3 Apr 2021 21:50:05 +0200
Subject: [PATCH] fix search scores
---
.../document-card-large.component.html | 8 ++++----
.../document-card-large.component.ts | 17 ++++++++---------
2 files changed, 12 insertions(+), 13 deletions(-)
diff --git a/src-ui/src/app/components/document-list/document-card-large/document-card-large.component.html b/src-ui/src/app/components/document-list/document-card-large/document-card-large.component.html
index f3037b4fc..3a552eb4e 100644
--- a/src-ui/src/app/components/document-list/document-card-large/document-card-large.component.html
+++ b/src-ui/src/app/components/document-list/document-card-large/document-card-large.component.html
@@ -62,10 +62,6 @@
-
- Score:
-
-
+
+ Score:
+
+
diff --git a/src-ui/src/app/components/document-list/document-card-large/document-card-large.component.ts b/src-ui/src/app/components/document-list/document-card-large/document-card-large.component.ts
index 0b7b7d793..d8f29ef5a 100644
--- a/src-ui/src/app/components/document-list/document-card-large/document-card-large.component.ts
+++ b/src-ui/src/app/components/document-list/document-card-large/document-card-large.component.ts
@@ -41,21 +41,20 @@ export class DocumentCardLargeComponent implements OnInit {
@Output()
clickMoreLike= new EventEmitter()
- @Input()
- searchScore: number
-
@ViewChild('popover') popover: NgbPopover
mouseOnPreview = false
popoverHidden = true
get searchScoreClass() {
- if (this.searchScore > 0.7) {
- return "success"
- } else if (this.searchScore > 0.3) {
- return "warning"
- } else {
- return "danger"
+ if (this.document.__search_hit__) {
+ if (this.document.__search_hit__.score > 0.7) {
+ return "success"
+ } else if (this.document.__search_hit__.score > 0.3) {
+ return "warning"
+ } else {
+ return "danger"
+ }
}
}