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

How do I disable or customize search operators? #521

Open
Thermal-Shock opened this issue Nov 1, 2022 · 0 comments
Open

How do I disable or customize search operators? #521

Thermal-Shock opened this issue Nov 1, 2022 · 0 comments

Comments

@Thermal-Shock
Copy link

I've inherited an mkdocs-material project which uses LunrJS for the search and I'm new to Lunr.

I see Lunr has various search operators such as wildcards, fields, etc. One of these would be colon (:) for field search.

My question is whether there is a way to disable this color(:) operator or customize the operators in general.

For example, we have "ERROR: This error ..." in our documentation. If the user searches for "ERROR This" it is found, but if the user searches for "ERROR: This" it will NOT be found. I'd like to gain more control over these operators and the separators.

I can see where I can customize the separators with "lunr.tokenizer.separator = new RegExp(...)", but what about disabling, adding, or customizing operators?

Thank you for your help.

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

1 participant