Index creation on exif tool data

Questions, comments, discussions. Over time certain topics might be moved to their own category.
Post Reply
mcarlosro
Posts: 11
Joined: Fri Jan 10, 2020 3:23 pm

Index creation on exif tool data

Post 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,

User avatar
rssfed23
Moderator
Moderator
Posts: 191
Joined: Mon Oct 14, 2019 1:18 pm
Location: United Kingdom
Contact:

Re: Index creation on exif tool data

Post 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
Please don't PM for general support; start a new thread with your issue instead.

mcarlosro
Posts: 11
Joined: Fri Jan 10, 2020 3:23 pm

Re: Index creation on exif tool data

Post 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

User avatar
rssfed23
Moderator
Moderator
Posts: 191
Joined: Mon Oct 14, 2019 1:18 pm
Location: United Kingdom
Contact:

Re: Index creation on exif tool data

Post by rssfed23 »

Document type: {{ document.document_type.label }}

There's an extra underscore in yours I think before label.
Please don't PM for general support; start a new thread with your issue instead.

mcarlosro
Posts: 11
Joined: Fri Jan 10, 2020 3:23 pm

Re: Index creation on exif tool data

Post 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.

User avatar
rssfed23
Moderator
Moderator
Posts: 191
Joined: Mon Oct 14, 2019 1:18 pm
Location: United Kingdom
Contact:

Re: Index creation on exif tool data

Post 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).
Please don't PM for general support; start a new thread with your issue instead.

mcarlosro
Posts: 11
Joined: Fri Jan 10, 2020 3:23 pm

Re: Index creation on exif tool data

Post by mcarlosro »

thanks.

Post Reply