You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Nice, great start!
Do you have a good justification for the 500 character cutoff? I think it's reasonable to assume that the search will search the entire note, and not just the 500 first characters.
Maybe we could default it to not reduce the lenght, but introduce a config value somewhere to reduce it for those that needs it.
Thoughts?
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.
As this is only relevant if the search feature is enabled, would it make sense to put it under "Enable search" in the default note settings? Or would you prefer it as part of the advanced settings?
At the moment I think a simple boolean flag would be sufficient for this, like SEARCH_INDEX_USE_FULL_NOTE or SEARCH_INDEX_TRUNCATE_CONTENT. Not sure if anybody would like to have a different character limit than 500.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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)