Recoll in Ubuntu Mate

Does someone have practical knowledge with recoll in UM? I think about work with recoll and Tags in whole system.

I use Recoll day in day out to search my documentation and ebooks. I’ve set it up to automatically reindex tour times a day. I use it from the command-line with a little script I wrote (see below).

These are a collection of notes I’ve made to help jog my memory.

Installation

sudo apt-get install recoll

Configuration

Configuration is on Desktop not the server.

  • Use the Recoll GUI app and set Preferences->Indexing
    Configuration…
    to index ~/doc.

  • Add *.swp, *.bak, *.BAK to Skipped names in Index
    Configuration.

  • Then run the indexing for the first time.

  • Set Recoll cron scheduling for 8:15, 12:15, 15:15 and 18:15. I
    used the Recoll GUI Preferences->Indexing Schedule menu command to
    set this up and it inserted the following into my login crontab
    file:

      # Set Recoll cron scheduling for 8:15, 12:15, 15:15 and 18:15.  15 9,12,15,18  * * * RCLCRON_RCLINDEX= RECOLL_CONFDIR="/home/srackham/.recoll/" /home/srackham/bin/recollindex.sh
    
  • Here’s my ~/bin/recollindex.sh script:

#!/bin/sh
#
# Wrapper for recollindex so it generates a log file.
#

LOGFILE=$HOME/bin/recollindex.log

echo `date`: Starting recollindex | tee --append $LOGFILE
(/usr/bin/recollindex 2>&1) >/dev/null  # Drop the noisy output.
exit_code=$?
if [ $exit_code -eq 0 ]; then
    echo `date`: Finished recollindex | tee --append $LOGFILE
else
    echo `date`: FAILED recollindex: exit code: $exit_code | tee --append $LOGFILE
fi
  • Edit the personal crontab (/var/spool/cron/crontabs/srackham) with
    crontab -e.
  • The indexer log file is ~/bin/recollindex.log.
  • To view the cron log: sudo grep CRON /var/log/syslog.

Tips

  • To set text files to open in GVim instead of MousePad: Open Thunar
    file manager; right-click on text file and select Open With->Open
    With Other Application…
    . I set Use a custom command to gvim --remote-silent so that all document open in a single instance of
    GVim.
  • Right-click on Recoll query result to Copy file name.

Query language

http://www.lesbonscomptes.com/recoll/usermanual/usermanual.html#RCL.SEARCH.LANG

If explicit AND or OR term separator is omitted then AND is assumed.

Query examples:

vim xubuntu               Documents with word vim and word xubuntu.
vim ext:txt               Documents with word vim and file extension txt.
vim ext:txt OR ext:html   Documents with word vim and file extension .txt or .html.
vim ext:txt/html          Same as previous (DOES NOT WORK IN RECOLL <1.20).
vim jetbrains -ext:pdf    Documents with vim and jetbrains but excluding files with .pdf extension.
filename:*mongo*          Documents with file name containing 'mongo'.

## Command-line usage

I use this bash function in ~/.bashrc for command-line searches:

# Document search. Lists file names that match query.
# Usage: ds query
function ds() {
    if [ "$*" ]; then
        # Recoll.
        # Command-line query | drop first two lines | extract file names.
        recoll -t -q $* \
            | tail -n +3 \
            | perl -pe 's|^.*\[file:\/\/(.*?)\].*$|\1|'
    else
        echo "missing search query" >&2
        return 1
    fi
}
1 Like

Thank you! Wow, that’s a lot info, I need time to read in to the matter! But you will get a feedback from me.

Hi @srackham
I want to know you, that I’m changing now my searching habit from opening single folders and sub-folders to use Recoll and so navigate direct to the searched file. I’m impressed how well it’s working. Even Thunderbird files can be found, if Thunderbird is closed! And now an other question:

Your Tips below I doesn’t really understand. Are they workarounds necessary for daily use? You know, my Linux knowledge is higher-beginners-level.

Edit the personal crontab (/var/spool/cron/crontabs/srackham) with
crontab -e.
The indexer log file is ~/bin/recollindex.log.
To view the cron log: sudo grep CRON /var/log/syslog.

If I open the crontab-file, theres written: don’t edit this file…or something like this…

Tips

To set text files to open in GVim instead of MousePad: Open Thunar
file manager; right-click on text file and select _Open With->Open
With Other Application.... I set _Use a custom command to gvim
--remote-silent so that all document open in a single instance of
GVim.
Right-click on Recoll query result to Copy file name.

What is GVim?

I’m very interested to know more, if you have the goodness! :blush: