-
Notifications
You must be signed in to change notification settings - Fork 74
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
Rewrite Lunr search module #192
Comments
Check out https://github.com/alanta/memoirs-theme/blob/main/Modules/LunrIndexer.cs from @alanta for some ideas. I especially like the HTML stripping regex for content. Edit: lol, just realized that's in the existing module too - might even "promote" it to a common utility extension since it has value elsewhere too. Regardless, the linked |
Some thoughts on index vs. bootstrapper file:
|
It's done! Really happy with how this turned out. It'll go out with a new release soon and I'll add comprehensive documentation to the docs site (and probably a search box 😄). I also need to put the finishing touches on how this flows through to Statiq Web. |
There's a lot of potential to improve the Lunr module for client-side searching. Specifically, the lunr-core project makes building search indexes at generation time practical and can save both payload size and index build time on the client.
Here's some random thoughts:
IDictionary<string, bool?>
where value indicates lazy for field definitions or only searchable (not immediate or lazy) if null. An enum might be clearer than bool?.title
(based onGetTitle()
),link
, andcontent
. Title and link should be immediate, content should be lazy (or just not part of reference item?).Config
should be able to specify a mapping from the document to one or more (or none) index items. Each item should be a dictionary or maybeIMetadata
.Document
for indexing, the keys should be converted to camelCase as per JS convention.The text was updated successfully, but these errors were encountered: