andersju / zzzfoo

Full-text desktop search with Rofi+Recoll
GNU General Public License v2.0
121 stars 8 forks source link

add search history feature #12

Open code-ink-space opened 2 years ago

code-ink-space commented 2 years ago

Hi, This is an excellent rofi tool for recoll. But I think it would really benefit having some way of remembering searches. I added a basic search history using the same idea for how it already displays the search results.

zzzfoo-search-history

It saves the history in a file: ~/.local/share/rofi/rofi_recoll_history By default it saves the 10 most recent searches, with the most recent listed first.

One minor thing though about my implementation: when making a new search that has a partial match in the search history. For example, if I want to search "fish" and the search history already has an entry for "fisherman", what will be submitted on search is "fisherman". A simple workaround is to enclose it in "double quotes" to treat it as a completely new search term. I'm unsure if there's a better way to address this but it's good enough for my needs.

Thanks for making this really helpful tool. Feel free to make any improvements as my python's really basic.