Page 1 of 1

Index creation on exif tool data

Posted: Sun Jan 19, 2020 2:30 pm
by mcarlosro
Hi,

I would like to creation an index on the metadata for a PDF file. Basically the pdf creation date.

I created the index, but don't get any data. Can you help? I have the document type properly assigned to the index.

Thanks,

Re: Index creation on exif tool data

Posted: Sun Jan 19, 2020 2:55 pm
by rssfed23
Did you re-build the index after changing it/adding in your template?

On the indexes page in settings > indexes you'll see a rebuild index button on the right of each index. If you've already got documents in Mayan you need to click that so it goes back and retrospectively indexes them (as usually indexing only happens on document upload).

If that doesn't work, then you'll also need to share the index template you actually used.
Something like

Code: Select all

{{ document.file_metadata_value_of.exiftool_CreateDate|slice:"0:4" }}
gives the year of document creation date (going by the files "created date" exif daa) and

Code: Select all

  {{ document.file_metadata_value_of.exiftool_CreateDate|slice:"5:7" }} gives the month
Which you likely saw in the screenshots anyway

Re: Index creation on exif tool data

Posted: Sun Jan 19, 2020 3:00 pm
by mcarlosro
Thanks. It worked.

Can you also help with the document type? I have

Code: Select all

 {{ document.document_type__label }}
but it doesn't work

Re: Index creation on exif tool data

Posted: Sun Jan 19, 2020 3:15 pm
by rssfed23
Document type: {{ document.document_type.label }}

There's an extra underscore in yours I think before label.

Re: Index creation on exif tool data

Posted: Sun Jan 19, 2020 3:20 pm
by mcarlosro
Thanks. It worked.

You might need to create a bug to the developer team as what I put is automatically generated from the combo box.

Re: Index creation on exif tool data

Posted: Sun Jan 19, 2020 3:28 pm
by rssfed23
Anyone is welcome to log a bug at the gitlab project

But in this case it's not a bug. The selection box/template sandbox is functioning correctly, it's just not the template function you think it is :)
It doesn't know you want to have a list of all document types when you click it but rather it's designed to show documents that have a specific label. That label would go between the two underscores.

E.g

Code: Select all

 {{ document.document_type_letter_label }}
It's a completely different type of search to show all document types.

The rest of the items in the dropdown follow a similar format, so if you come across something similar again that's likely why, and I recommend checking out the indexes guide post to see a whole bunch of other index examples as it'll help figure out when you're referring to a specific label or metadata label vs wanting to list all the labels (what the .label does here).

Re: Index creation on exif tool data

Posted: Sun Jan 19, 2020 4:17 pm
by mcarlosro
thanks.