mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-10-30 03:56:23 -05:00 
			
		
		
		
	fix search scores
This commit is contained in:
		| @@ -62,10 +62,6 @@ | ||||
|           </div> | ||||
|  | ||||
|           <div class="list-group list-group-horizontal border-0 card-info ml-md-auto mt-2 mt-md-0"> | ||||
|             <div *ngIf="document.__search_hit__" class="list-group-item bg-light text-dark p-1 mr-5 border-0 d-flex search-score"> | ||||
|               <small class="text-muted" i18n>Score:</small> | ||||
|               <ngb-progressbar [type]="searchScoreClass" [value]="document.__search_hit__.score" class="search-score-bar mx-2 mt-1" [max]="1"></ngb-progressbar> | ||||
|             </div> | ||||
|             <button *ngIf="document.document_type" type="button" class="list-group-item btn btn-sm bg-light text-dark p-1 border-0 mr-2" title="Filter by document type" | ||||
|              (click)="clickDocumentType.emit(document.document_type);$event.stopPropagation()"> | ||||
|               <svg class="metadata-icon mr-2 text-muted bi bi-file-earmark" viewBox="0 0 16 16" fill="currentColor"> | ||||
| @@ -86,6 +82,10 @@ | ||||
|               </svg> | ||||
|               <small>{{document.created | customDate:'mediumDate'}}</small> | ||||
|             </div> | ||||
|             <div *ngIf="document.__search_hit__" class="list-group-item bg-light text-dark border-0 d-flex search-score"> | ||||
|               <small class="text-muted" i18n>Score:</small> | ||||
|               <ngb-progressbar [type]="searchScoreClass" [value]="document.__search_hit__.score" class="search-score-bar mx-2 mt-1" [max]="1"></ngb-progressbar> | ||||
|             </div> | ||||
|           </div> | ||||
|         </div> | ||||
|  | ||||
|   | ||||
| @@ -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" | ||||
|       } | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 jonaswinkler
					jonaswinkler