<app-page-header title="Search results">
</app-page-header>

<div *ngIf="errorMessage" class="alert alert-danger">Invalid search query: {{errorMessage}}</div>

<p *ngIf="more_like">
    Showing documents similar to
    <a routerLink="/documents/{{more_like}}">{{more_like_doc?.original_file_name}}</a>
</p>

<p *ngIf="query">
    Search string: <i>{{query}}</i>
    <ng-container *ngIf="correctedQuery">
        - Did you mean "<a [routerLink]="" (click)="searchCorrectedQuery()">{{correctedQuery}}</a>"?
    </ng-container>

</p>

<div *ngIf="!errorMessage" [class.result-content-searching]="searching" infiniteScroll (scrolled)="onScroll()">
    <p>{{resultCount}} result(s)</p>
    <app-document-card-large *ngFor="let result of results"
        [document]="result.document"
        [details]="result.highlights"
        [searchScore]="result.score / maxScore"
        [moreLikeThis]="true">

</app-document-card-large>
</div>
