add note content searching #1928
Open
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.
closes #1238
adds 6 predicates of 3 types:
system:has note that contains: searches for content that has notes which contain, anywhere in the note, the user specified content.LIKE '%word%'in sqlitesystem:has note that matches: searches for content that has notes that 100% match the user specified contentLIKE 'word'system:has note that contains the words: searched for content that has notes which contain, in any order, each word the user specifies.LIKE '%word1%' AND LIKE '%word2%' AND LIKE '%word3%' ....each of these predicates has a corresponding "not" predicate that searches for stuff that DOESN'T match it.
all inputs intentionally support the sqlite LIKE special characters:
%matches 0+ characters (like regex*) and_matches one character (like regex.). the user can escape these with\. wasnt sure how to communicate this. i like this choice because, without any special characters, LIKE behaves exactly like=.I also added GUI under the

system:notespopup for theseperhaps, in the future, a more comprehensive search like FTS5 could be implemented, but this requires changes to the underlying database (adding virtual tables that sqlite manages to help index search), so I didn't do that for this.
I tried my best to match your code style (had to do a lot of configuring to get the indents to work).
Tested and working on python 3.13