programming (and other) musings
22 Jul 2022

consult recoll with live preview

Lately, i've gravitated towards recoll as a unified search engine for all my local data, including org and text notes, documents in PDF or similar formats, HTML files, and local email. As a result, my little consult-recoll package has gone up a few notches up in my list. i've just released version 0.5, featuring live previews.


Recoll is a local search engine that knows how to index a wide variety of file formats. It also offers a sophisticated query language, and, for some document kinds, snippets of the text of the document that actually match your query: that's always been one of my favourite features, and wanted to bring it to emacs.

i found consult's live previews a very nice venue to bring snippets into emacs, via a new version of consult-recoll, and there you go, just a small matter of programming1.

There are several things of this package that make me happy. For one, it's very small (less than 200 lines of code, including comments) and does quite a bit, thanks to the help of consult on the emacs side and of recoll on the system's side. In my opinion, it's a very good example of how the operative environment provided by emacs brings the Unix philosophy to the next level: here, it's gluing together functionality provided by emacs packages (completing read, consult's asynchronous searches and previews, and so on), and the indexing and search capabilities of a totally unrelated, orthogonal program, recoll, which in turn delegates to a swarm of other unix programs (such as antiword, unrtf, poppler, pstotext and a long etc) to extract information from local files2. Very pleasant!



If you're not into consult, my unpublished little library jao-recoll knows how to render recoll query results (including snippets) in an org-prettified buffer.


Another way in which recoll is true to the same philosophy is in its nice separation of indexing, query and presentation programs; for instance, its CLI interface, recollq, is what made consult-recoll such a breeze.

Tags: emacs
Creative Commons License by jao is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.