getmoro/moro

[feature] Search notes?

Closed this issue · 4 comments

I really like this utility. I'm not only using it to log my working hours, I am also using it to log work events with hashtags. It would be great if moro can provide text search. Thanks :)

Glad you like it @ConanChou

Good idea. We will implement it when I or someone else finds some time.

Meanwhile you might do something like this to search in notes:

moro report --all | grep YourSearchTermHere

Just from the top of my mind:

CLI Switch

moro search <search_term>

Should be simple enough. We must only make sure to sanitize the user input.

Data

SELECT date,createdat,note FROM notes WHERE note LIKE "%<search_term>%";

This returns the date, the time and the text for the note with a case-insensitive search. Of course the actual syntax must be checked and the node-library has a syntax but you get the general idea.

Display

┌─────────────┬───────┬───────────────────┐
│ Date        │ Time  │ Note              │
├─────────────┼───────┼───────────────────┤
│ 2017-07-31  │ 10:10 │ Customer :: Task  |
├─────────────┼───────┼───────────────────┤

Or something of the like.

Again this is just a quick thought. It depends a little on the use case and how the notes are structured. But this is the way I naively would implement this.

Yeah seems like a plan. Thanks @fleischie

Thanks to @fleischie now Moro 3.0.1 is published and it has the search feature.
Hopefully it works the way you expected it @ConanChou