Unix-like systems: using extended attributes

User extended attributes are named pieces of information that most modern file systems can attach to any file.

Recoll processes all extended attributes as document fields. Note that most fields are not indexed by default, you need to activate them by defining a prefix in the fields configuration file.

A freedesktop standard defines a few special attributes, which are handled as such by Recoll:

mime_type

If set, this overrides any other determination of the file MIME type.

charset

If set, this defines the file character set (mostly useful for plain text files).

By default, other attributes are handled as Recoll fields of the same name.

On Linux, the user prefix is removed from the name.

The name translation can be configured more precisely, also inside the fields configuration file.

Setting the document modification/creation date

Date fields are processed specially by Recoll. For obscure and uninteresting reasons, you should use modificationdate as extended attribute name for setting this value. Also, the date string should be an ASCII integer representing the Unix time (seconds since the epoch). An example Linux command line for setting this particular field follow. The substituted date prints the example date parameter in Unix time format (seconds since the epoch).

              setfattr -n user.modificationdate -v `date -d '2022-09-30 08:30:00' +%s` /some/file
            

The date substitution will then be automatic, you do not need to customize the fields file.