Discussion:
[Mayan EDMS: 2654] Index by document type
Valen
2018-08-19 07:45:48 UTC
Permalink
Hi!

I seem to have understand the concept of indices and it is great!

I would like to build a simple 1 level index (for now) with the document
type as first level. I have not managed to access the type, how do I do
that? Is it at all possible?

Also: I have not found this in the docs, are the indices build regularly or
only manually? If the latter, can I then make a cron-job using the API?

Thanks and have a great day!
--
---
You received this message because you are subscribed to the Google Groups "Mayan EDMS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mayan-edms+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Roberto Rosario
2018-08-20 04:02:33 UTC
Permalink
Hello, that's great :) Indexes are the "killer" feature of Mayan. They
allow automatic categorization of documents.

Once created, indexes are updated automatically when the document type,
metadata or tags change. When you change the structure of an index by
editing its template you need to trigger a rebuild using the "Rebuil Index"
entry on the Tools menu. This is also needed if you create a new index and
already have uploaded documents in the system.

For a document type index. These are the steps required:

1. Create a new index and name it "By document type" and add a similar
entry for the name. The name is an identifier in case you want to reference
this index in other parts of Mayan. That is why it is formatted like a
variable name (no spaces, special characters).
2. Create a new child node template under the "Root" node.
3a. Use the following text for the template: {{ document.document_type }}
3b. Click on "Link documents". This is to put links to the corresponding
documents of the document type being generated. Sometimes you want an index
level with other sub index levels, in those cases you keep "Link documents".
4. Associate this index with the document type you want it to react to. Use
the "Document types" button of the index.
5. Rebuild the index using the Tools menu.

There will by a new entry under the "Index" main menu. Every time a
document is uploaded or modified a link will appear under the corresponding
document type. If you create a new document type don't forget to associate
it with the index.

When you become comforntable with index template you can create mult level
indexes. For example: A top level for each document type and sub level for
the value of a metadata field like "supplier" or "organization". All the
properties of a document can be used as source for the index levels. The
index template also support conditional statements for even more intricate
index structures.

{% if document.metadata_value_of.invoice_number.0 == "A" %}Accounting
{% if document.metadata_value_of.invoice_number.0 == "H" %}Human Resources
{% endif %}

This creates an index level whose value changes based on the first
character of the invoice number of the document for different departments.

I'll start an "Index recipes" page on the wiki (wiki.mayan-edms.com) so
users can add their own indexes for specific use cases.
Post by Valen
Hi!
I seem to have understand the concept of indices and it is great!
I would like to build a simple 1 level index (for now) with the document
type as first level. I have not managed to access the type, how do I do
that? Is it at all possible?
Also: I have not found this in the docs, are the indices build regularly
or only manually? If the latter, can I then make a cron-job using the API?
Thanks and have a great day!
--
---
You received this message because you are subscribed to the Google Groups "Mayan EDMS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mayan-edms+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Valen
2018-08-20 05:43:02 UTC
Permalink
Hi!

Thank you very much! Works as advertised.

Yes indexing is a killer feature! I managed to make an index "original
date" in conjunction with the document analyzer regexing the date out of
the documents. Works very well. I can make a recipe for that in the wiki
too, if you like.

The main issue I have is the state of the documentation in this case, I had
no idea that I could access the document type that way. Is there already an
overview of how to access the data associated with an document with
templating? I get metadata and analyzer data, but what about the built in
stuff like document type (answered here), langauge, filename etc. An
overview for that would be nice.

Thank you very much and have a great day!
Post by Roberto Rosario
Hello, that's great :) Indexes are the "killer" feature of Mayan. They
allow automatic categorization of documents.
Once created, indexes are updated automatically when the document type,
metadata or tags change. When you change the structure of an index by
editing its template you need to trigger a rebuild using the "Rebuil Index"
entry on the Tools menu. This is also needed if you create a new index and
already have uploaded documents in the system.
1. Create a new index and name it "By document type" and add a similar
entry for the name. The name is an identifier in case you want to reference
this index in other parts of Mayan. That is why it is formatted like a
variable name (no spaces, special characters).
2. Create a new child node template under the "Root" node.
3a. Use the following text for the template: {{ document.document_type }}
3b. Click on "Link documents". This is to put links to the corresponding
documents of the document type being generated. Sometimes you want an index
level with other sub index levels, in those cases you keep "Link documents".
4. Associate this index with the document type you want it to react to.
Use the "Document types" button of the index.
5. Rebuild the index using the Tools menu.
There will by a new entry under the "Index" main menu. Every time a
document is uploaded or modified a link will appear under the corresponding
document type. If you create a new document type don't forget to associate
it with the index.
When you become comforntable with index template you can create mult level
indexes. For example: A top level for each document type and sub level for
the value of a metadata field like "supplier" or "organization". All the
properties of a document can be used as source for the index levels. The
index template also support conditional statements for even more intricate
index structures.
{% if document.metadata_value_of.invoice_number.0 == "A" %}Accounting
{% if document.metadata_value_of.invoice_number.0 == "H" %}Human Resources
{% endif %}
This creates an index level whose value changes based on the first
character of the invoice number of the document for different departments.
I'll start an "Index recipes" page on the wiki (wiki.mayan-edms.com) so
users can add their own indexes for specific use cases.
Post by Valen
Hi!
I seem to have understand the concept of indices and it is great!
I would like to build a simple 1 level index (for now) with the document
type as first level. I have not managed to access the type, how do I do
that? Is it at all possible?
Also: I have not found this in the docs, are the indices build regularly
or only manually? If the latter, can I then make a cron-job using the API?
Thanks and have a great day!
--
---
You received this message because you are subscribed to the Google Groups "Mayan EDMS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mayan-edms+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Valen
2018-08-20 10:17:02 UTC
Permalink
BTW I found a bug (maybe?): If I make a more complex index defenition, it
will become a multiline configuration. When I mount that with the fuse (the
other killer feature!), the folder names are all wacky because of the
newlines not stripped away like in the web UI....
Post by Roberto Rosario
Hello, that's great :) Indexes are the "killer" feature of Mayan. They
allow automatic categorization of documents.
Once created, indexes are updated automatically when the document type,
metadata or tags change. When you change the structure of an index by
editing its template you need to trigger a rebuild using the "Rebuil Index"
entry on the Tools menu. This is also needed if you create a new index and
already have uploaded documents in the system.
1. Create a new index and name it "By document type" and add a similar
entry for the name. The name is an identifier in case you want to reference
this index in other parts of Mayan. That is why it is formatted like a
variable name (no spaces, special characters).
2. Create a new child node template under the "Root" node.
3a. Use the following text for the template: {{ document.document_type }}
3b. Click on "Link documents". This is to put links to the corresponding
documents of the document type being generated. Sometimes you want an index
level with other sub index levels, in those cases you keep "Link documents".
4. Associate this index with the document type you want it to react to.
Use the "Document types" button of the index.
5. Rebuild the index using the Tools menu.
There will by a new entry under the "Index" main menu. Every time a
document is uploaded or modified a link will appear under the corresponding
document type. If you create a new document type don't forget to associate
it with the index.
When you become comforntable with index template you can create mult level
indexes. For example: A top level for each document type and sub level for
the value of a metadata field like "supplier" or "organization". All the
properties of a document can be used as source for the index levels. The
index template also support conditional statements for even more intricate
index structures.
{% if document.metadata_value_of.invoice_number.0 == "A" %}Accounting
{% if document.metadata_value_of.invoice_number.0 == "H" %}Human Resources
{% endif %}
This creates an index level whose value changes based on the first
character of the invoice number of the document for different departments.
I'll start an "Index recipes" page on the wiki (wiki.mayan-edms.com) so
users can add their own indexes for specific use cases.
Post by Valen
Hi!
I seem to have understand the concept of indices and it is great!
I would like to build a simple 1 level index (for now) with the document
type as first level. I have not managed to access the type, how do I do
that? Is it at all possible?
Also: I have not found this in the docs, are the indices build regularly
or only manually? If the latter, can I then make a cron-job using the API?
Thanks and have a great day!
--
---
You received this message because you are subscribed to the Google Groups "Mayan EDMS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mayan-edms+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...