Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support metadataWhitelist #120

Closed
epicfaace opened this issue Feb 1, 2023 · 1 comment
Closed

Support metadataWhitelist #120

epicfaace opened this issue Feb 1, 2023 · 1 comment

Comments

@epicfaace
Copy link

epicfaace commented Feb 1, 2023

It would be good to support metadataWhitelist to store index positions, see https://github.com/olivernn/moonwalkers/blob/6d5a6e976921490033681617e92ea42e3a80eed0/build-index#L23-L29 and olivernn/lunr.js#25

@yeraydiazdiaz
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants