Fixed title and tags being empty for some search queries

This commit is contained in:
squidfunk
2022-12-07 20:41:44 +01:00
parent 0570b1aa5c
commit 13680a5863
11 changed files with 21 additions and 17 deletions

View File

@@ -235,6 +235,10 @@ export class Search {
if (field in match)
positions.push(...match[field].position)
/* Skip field, if no highlighting is necessary */
if (!positions.length)
continue
// @ts-expect-error - @todo fix typings
if (Array.isArray(doc[field])) {
// @ts-expect-error - @todo fix typings