Skip to content

Note Search: /search <query>#19

Open
cristoforows wants to merge 1 commit into
mainfrom
wesley/note-search
Open

Note Search: /search <query>#19
cristoforows wants to merge 1 commit into
mainfrom
wesley/note-search

Conversation

@cristoforows

Copy link
Copy Markdown
Owner

Closes #14.

What

Auth-gated /search <query> that finds captured notes across all daily Drive files and replies with dated matches. e.g. /search dentist.

How

  • search.py (new): pure parse_blocks / find_matches (case-insensitive substring) / _snippet / _date_of. search_command lists the folder's markdown files, scans the most recent _MAX_FILES (60, newest first), collects up to _MAX_HITS (20) snippets, and replies [date] snippet.
  • drive_handler.py: adds list_markdown_files and read_file (read-only).
  • bot.py: registers /search, adds it to help/start text.

Notes

  • Scanning is capped so a long history stays cheap; oldest files beyond the cap are skipped.
  • Reply length capped under Telegram's limit.

Test

  • tests/test_search.py: block parsing, case-insensitive matching, no-match, snippet collapse/truncate, date extraction. Full suite green (18 passed).

New search.py command (auth-gated) that scans the most recent daily
Drive files (capped) for a case-insensitive substring and replies with
dated snippets. Adds drive_handler.list_markdown_files/read_file. Closes #14.
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.

Note Search: /search <query>

1 participant