None
closed
nobody
None
2019-12-12
2019-12-11
Imran Iqbal
No

Using the stock Recoll version for Ubuntu Bionic:

$ recollindex --help 2>&1 | grep version
Recoll version: Recoll 1.23.7 + Xapian 1.4.5

I'm finding that my *.rb files are being processed but aren't accessible to search (other than by filename), preview or open. Surely Ruby files should be supported like the other languages? Or perhaps there are suggestions to how best to search inside these files and take advantage of the previewer?

Discussion

  • medoc
    medoc
    2019-12-11

    Thanks for reporting this. Ruby files were forgotten in the list of programming language files, and apparently your xdg mimetype does not detect them as text. I added ruby in the default config for the next version. Almost all programming languages are processed as pure text, with the exception of Python, which uses a pretty printer in the preview.

    Until the next version arrives, you can get the .rb files to be indexed by editing configuration files in ~/.recoll/ (by default):

    in ~/.recoll/mimemap:

    .rb = text/x-ruby
    

    in ~/.recoll/mimeconf:

    [index]
    text/x-ruby = internal
    

    (the text/ part is recognized to mean process as text/plain if not told otherwise).

    You should then be able to use something like:

    find ~ -name '*.rb' | recollindex -e -i
    

    to force the Ruby file contents to be indexed after updating the configuration.

     
    Last edit: medoc 2019-12-11
    • Imran Iqbal
      Imran Iqbal
      2019-12-11

      Excellent, that got both the search and preview working.

      I needed to add the following to ~/.recoll/mimeview to get the open link displayed:

      [view]
      text/x-ruby = vim %f
      

      For cosmetic purposes, also added the following to ~/.recoll/mimeconf:

      [icons]
      text/x-ruby = source
      

      Thanks a lot for your help!

       
  • medoc
    medoc
    2019-12-12

    Thanks, I'll update mimeview and icons too.

    And will add application/x-ruby to mimeconf just in case. It was in the title...

    On my Ubuntu system, file -i returns text/x-ruby, and xdg-mime query filetype returns application/x-ruby...

     
  • medoc
    medoc
    2019-12-12

    • status: open --> closed
    • milestone: -->
     

Cancel   Add attachment