Adding indexing support for a new file type

Let us now imagine that the above .blob files actually contain indexable text and that you know how to extract it with a command line program. Getting Recoll to index the files is easy. You need to perform the above alteration, and also to add data to the mimeconf file (typically in ~/.recoll/mimeconf):

  • Under the [index] section, add the following line (more about the rclblob indexing script later):

    application/x-blobapp = exec rclblob

    Or if the files are mostly text and you don't need to process them for indexing:

    application/x-blobapp = internal text/plain

  • Under the [icons] section, you should choose an icon to be displayed for the files inside the result lists. Icons are normally 64x64 pixels PNG files which live in /usr/share/recoll/images.

  • Under the [categories] section, you should add the MIME type where it makes sense (you can also create a category). Categories may be used for filtering in advanced search.

The rclblob handler should be an executable program or script which exists inside /usr/share/recoll/filters. It will be given a file name as argument and should output the text or html contents on the standard output.

The filter programming section describes in more detail how to write an input handler.