1
0
mirror of https://github.com/nextapps-de/flexsearch.git synced 2025-10-03 16:41:50 +02:00

fix result highlighting #489

This commit is contained in:
Thomas Wilkerling
2025-04-17 10:09:16 +02:00
parent dafb137153
commit b75cccb0f8
26 changed files with 171 additions and 87 deletions

View File

@@ -516,7 +516,7 @@ function highlight_fields(query, result, index, pluck, template) {
// prefix
doc_org_cur.substring(0, position) +
// match
template.replace("$1", doc_org_cur.substring(position, query_enc_cur.length)) +
template.replace("$1", doc_org_cur.substring(position, position + query_enc_cur.length)) +
// suffix
doc_org_cur.substring(position + query_enc_cur.length);
found = !0;