Hi,
This is a complex query because it uses the combination of three pairs.
As a search query
It cannot be expressed using the user interface and needs to be composed manually. We created a search language used internally by Mayan that remains the same regardless of the search backend used. All user queries are translated into this language before processing.
Your search has 4 elements: 3 combinations plus 1 final combination of all first 3.
- “judge” AND “A”
- “grade” AND “second instance”
- “type” AND “civil”
-
#1 AND #2 AND #3
Written in Mayan’s search language that would be:
Element 1, Judge:
__J0_metadata__metadata_type__name=="judge"&__J1_metadata__value=="A"&__J2=AND_J0_J1
Element 2, Grade:
__G0_metadata__metadata_type__name=="grade"&__G1_metadata__value=="first grade"&__G2=AND_G0_G1
Element 3, Type:
__T0_metadata__metadata_type__name=="type"&__T1_metadata__value=="civil"&__T2=AND_T0_T1
Element 4, combine all previous 3:
__R=AND_J2_G2_T2&__result=R
The complete URL is as follows:
https://< Your Mayan EDMS URL >/#/search/results/?_search_model_pk=documents.documentsearchresult&__J0_metadata__metadata_type__name=="judge"&__J1_metadata__value=="a"&__J2=AND_J0_J1&__G0_metadata__metadata_type__name=="grade"&__G1_metadata__value=="first grade"&__G2=AND_G0_G1&__T0_metadata__metadata_type__name=="type"&__T1_metadata__value=="civil"&__T2=AND_T0_T1&__R=AND_J2_G2_T2&__result=R
If you typed it correctly the search explainer should look like this or similar.
The same search works via the API:
https://< Your Mayan EDMS URL >/api/v4/search/documents.documentsearchresult/?__J0_metadata__metadata_type__name=="judge"&__J1_metadata__value=="a"&__J2=AND_J0_J1&__G0_metadata__metadata_type__name=="grade"&__G1_metadata__value=="first grade"&__G2=AND_G0_G1&__T0_metadata__metadata_type__name=="type"&__T1_metadata__value=="civil"&__T2=AND_T0_T1&__R=AND_J2_G2_T2&__result=R
As an index
You can also use a multi level index to automatically categorize the documents by these values.
If the order Judge → Grade → Type does not work, you can use any order, or create multiple indexes with different orders:
- Grade → Type → Judge
- Type → Judge → Grade.