Skip to content

Remove query parser characters from search term#2148

Open
travisbeckham wants to merge 1 commit into
mainfrom
travis/search
Open

Remove query parser characters from search term#2148
travisbeckham wants to merge 1 commit into
mainfrom
travis/search

Conversation

@travisbeckham

@travisbeckham travisbeckham commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

Lunr's query parser treats characters like : + - * ~ ^ as query syntax, so this PR removes them to keep user input literal and avoid throwing an error if a search term contains one of them.

Lunr docs
https://lunrjs.com/guides/searching.html#fields

The search term is prefixed with the name of the field, followed by a colon (:). The field must be one of the fields defined when building the index. Unrecognised fields will lead to an error.

Signed-off-by: Travis Beckham <travis@buoyant.io>
@travisbeckham
travisbeckham requested a review from alpeb July 24, 2026 14:13
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

Successfully merging this pull request may close these issues.

1 participant