fix search scores

This commit is contained in:
jonaswinkler 2021-04-03 21:50:05 +02:00
parent b7063b199a
commit be87caf7f6
2 changed files with 12 additions and 13 deletions

View file

@ -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"
}
}
}