Closed epicfaace closed 1 year ago
Metadata whitelist is already supported, please see https://lunr.readthedocs.io/en/latest/customisation.html#token-meta-data
To have the position returned in the match data you simply need to append it to the whitelist:
builder.metadata_whitelist.append("position")
No need to register a function to the pipeline.
It would be good to support metadataWhitelist to store index positions, see https://github.com/olivernn/moonwalkers/blob/6d5a6e976921490033681617e92ea42e3a80eed0/build-index#L23-L29 and https://github.com/olivernn/lunr.js/issues/25