Skip to content

Conversation

@machineonamission
Copy link

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.
    • under the hood this in essence does LIKE '%word%' in sqlite
  • system:has note that matches: searches for content that has notes that 100% match the user specified content
    • LIKE 'word'
  • system:has note that contains the words: searched for content that has notes which contain, in any order, each word the user specifies.
    • uses some python to preprocess, but results in essentially 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:notes popup for these
image

perhaps, 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

@machineonamission
Copy link
Author

Maybe it would be better if i used GLOB instead of LIKE, the * syntax is more familiar, but glob is always case sensitive which is probably not desireable

@machineonamission machineonamission deleted the branch hydrusnetwork:master December 28, 2025 23:34
@machineonamission machineonamission deleted the master branch December 28, 2025 23:34
@machineonamission machineonamission restored the master branch January 29, 2026 20:58
@machineonamission
Copy link
Author

i did not mean to delete that

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.

Search the content of notes

1 participant