1
0
mirror of https://github.com/nextapps-de/flexsearch.git synced 2025-10-04 00:51:52 +02:00

support highlighting on resolver

This commit is contained in:
Thomas Wilkerling
2025-05-23 11:18:13 +02:00
parent 809119b492
commit db56fa1070
69 changed files with 5761 additions and 5038 deletions

View File

@@ -1,12 +1,13 @@
import { parse_simple } from "../common.js";
import Index from "../index.js";
import WorkerIndex from "../worker.js";
import { EnrichedDocumentSearchResults, EnrichedSearchResults, HighlightOptions } from "../type.js";
/**
* @param {string} query
* @param {EnrichedDocumentSearchResults|EnrichedSearchResults} result
* @param {Map<string, Index>} index
* @param {Map<string, Index|WorkerIndex>} index
* @param {string} pluck
* @param {HighlightOptions|string} config
* @return {EnrichedDocumentSearchResults|EnrichedSearchResults}
@@ -79,7 +80,6 @@ export function highlight_fields(query, result, index, pluck, config) {
let res;
if (pluck) {
res = result;
path = pluck;
} else {
@@ -92,7 +92,6 @@ export function highlight_fields(query, result, index, pluck, config) {
idx = index.get(path);
enc = idx.encoder;
idx.tokenize;
query_enc = encoder.get(enc);
if ("string" != typeof query_enc) {