comment search highlighting

This commit is contained in:
Michael Shamoon
2023-01-04 19:06:51 -08:00
parent 91d4941438
commit b869ad02a1
3 changed files with 18 additions and 2 deletions

View File

@@ -25,7 +25,13 @@
</h5>
</div>
<p class="card-text">
<span *ngIf="document.__search_hit__" [innerHtml]="document.__search_hit__.highlights"></span>
<span *ngIf="document.__search_hit__ && document.__search_hit__.highlights" [innerHtml]="document.__search_hit__.highlights"></span>
<span *ngIf="document.__search_hit__ && document.__search_hit__.comment_highlights">
<svg width="1em" height="1em" fill="currentColor" class="me-2">
<use xlink:href="assets/bootstrap-icons.svg#chat-left-text"/>
</svg>
<span [innerHtml]="document.__search_hit__.comment_highlights"></span>
</span>
<span *ngIf="!document.__search_hit__" class="result-content">{{contentTrimmed}}</span>
</p>

View File

@@ -10,6 +10,7 @@ export interface SearchHit {
rank?: number
highlights?: string
comment_highlights?: string
}
export interface PaperlessDocument extends ObjectWithId {