Reduce size of search index#338
Conversation
|
Nice, great start! |
|
My goal was to reduce the index size with the trade off of having slightly worse search results. I made the decision to only use 500 characters, as I assume that the first 500 characters already contain the most relevant keywords. But it makes sense to make it configurable. |
Keeps full note content in the search index to avoid reducing search recall for content beyond the first 500 characters. The other size optimizations (HTML stripping, whitespace collapsing, JSON minification) are sufficient. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Resolve conflict in .eleventy.js: keep stripForSearch filter and use main's searchableTags function signature. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The date field may be used by consumers for display or sorting. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
I've removed the 500 character limit, and kept the date field. Not sure why you deleted that in your PR? The minification is a nice addition. If you ever want to add support for setting a content limit in settings I'd be happy to have a look at the PR. But for now I'll make it so everything in every note is searchable. |
|
Thanks for modifying and merging the PR! If I will find the time in the (near) future, I maybe create a PR regarding the content limit configuration. |
The JSON file for the search index had a size of 2 MB on my site:
I think this is too big. With the changes in this PR the search index on my site is now reduced to 292 kB:
Changes:
striptags(true) | linkwas not sufficient)