mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-10-30 03:56:23 -05:00 
			
		
		
		
	Better deal with non-existing documents when searching
This commit is contained in:
		| @@ -16,11 +16,13 @@ | ||||
|  | ||||
| <div *ngIf="!errorMessage" [class.result-content-searching]="searching" infiniteScroll (scrolled)="onScroll()"> | ||||
|     <p i18n>{resultCount, plural, =0 {No results} =1 {One result} other {{{resultCount}} results}}</p> | ||||
|     <app-document-card-large *ngFor="let result of results" | ||||
|         [document]="result.document" | ||||
|         [details]="result.highlights" | ||||
|         [searchScore]="result.score / maxScore" | ||||
|         [moreLikeThis]="true"> | ||||
|     <ng-container *ngFor="let result of results"> | ||||
|         <app-document-card-large *ngIf="result.document" | ||||
|             [document]="result.document" | ||||
|             [details]="result.highlights" | ||||
|             [searchScore]="result.score / maxScore" | ||||
|             [moreLikeThis]="true"> | ||||
|         </app-document-card-large> | ||||
|     </ng-container> | ||||
|  | ||||
| </app-document-card-large> | ||||
| </div> | ||||
|   | ||||
| @@ -28,7 +28,11 @@ export class SearchService { | ||||
|     } | ||||
|     return this.http.get<SearchResult>(`${environment.apiBaseUrl}search/`, {params: httpParams}).pipe( | ||||
|       map(result => { | ||||
|         result.results.forEach(hit => this.documentService.addObservablesToDocument(hit.document)) | ||||
|         result.results.forEach(hit => { | ||||
|           if (hit.document) { | ||||
|             this.documentService.addObservablesToDocument(hit.document) | ||||
|           } | ||||
|         }) | ||||
|         return result | ||||
|       }) | ||||
|     ) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 jonaswinkler
					jonaswinkler