11-14-2019 07:07 AM
Hi,
I've got a folder with a multiple property called my:dossierCodes.
I want to see inside a smart folder all dossiers that has one of my codes, so I'm trying to apply this Smart Folder Template:
{
"language": "fts-alfresco",
"query": "+TYPE:'my:dossierType' AND =my:dossierCode:'<my:dossierCodes>'"
}
I have no results.
It's the first time I use multiple-value properties. How does they work in FTS queries?
Thanks
11-14-2019 07:16 AM
Hi,
Can you post the real value used to perform the query?
KR,
11-14-2019 08:06 AM
The real value of my:dossierCodes is the array: ["1234", "4321"].
If I try to do this query:
+TYPE:"my:dossierType" AND =my:dossierCode"1234" OR "4321")
I get 3 nodes.
11-14-2019 08:46 AM
Try with :
+TYPE:"my:dossierType" AND (=my:dossierCode:"1234" OR =my:dossierCode:"4321")
(maybe you will need to scape " characters)
Multivalued props are text props at the end.
KR,
11-14-2019 08:56 AM
This query do the same of yours, and it works fine for me:
+TYPE:"my:dossierType" AND =my:dossierCode:("1234" OR "4321")
It rapresents the result that I want to have on my smart folder.
I need to know how I could parameterize my multi-value property in the smart folder template to do this.
11-14-2019 10:33 AM
I need to know how I could parameterize my multi-value property in the smart folder template to do this.
I think you are doing wrong assumptions, because, extracted from https://docs.alfresco.com/6.0/concepts/sf-ref-template-guidance.html :
Use angle brackets, for example, <cm:name>, to inherit property values from the physical parent folder. Used for inheritance in a filing rule and in a query.
So, basically brackets are used to inherit parent properties in nested json entries queries for smart folder templates.
Can you explain your use case in detail?
KR,
11-14-2019 11:14 AM
This is my data model:
<type name="my:dossierType"> <parent>cm:folder</parent> <properties> <property name="my:dossierCode"> <type>d:text</type> <mandatory>true</mandatory> </property> </properties> </type> .. .. .. <aspect name="my:dossierViewAspect"> <properties> <property name="my:dossierCodes"> <type>d:text</type>
<mandatory>true</mandatory>
<multiple>true</multiple> </property> </properties> </aspect>
I've got 3 nodes:
I want to see on the node called View the dossiers with the codes matching with one of my:dossierCodes values.
To do this, I added to the View node this smart folder template:
{ "nodes": [ { "search": { "query": "+TYPE:'my:dossierType' AND =my:dossierCode:'<my:dossierCodes>'", "language": "fts-alfresco" }, "name": "Dossiers" } ], "name": "Dossiers" }
As you see, I'm already using brackets on <my:dossierCodes>, but in the guide there's any reference about what happens when a multi-value property is inherited.
The other query I wrote on my previous post is only a sample to make you understand which result I want to receive in the View node in the end.
Thanks in advance
11-14-2019 11:28 AM
I don't see any multi-value property in your model.
Can you show us
my:dossierCodes
sample value in node browser?
KR,
11-14-2019 11:39 AM
So sorry!!!
I missed it doing copy/paste
This is the right aspect definition:
<aspect name="my:dossierViewAspect"> <properties> <property name="my:dossierCodes"> <type>d:text</type> <mandatory>true</mandatory> <multiple>true</multiple> </property> </properties> </aspect>
11-14-2019 11:49 AM
Ok, I guess its passing all values as object.
So, View entry is "the parent" of First and Second node in json template structure, right?
Quick answer : I don't think its possible to do what you are thinking.
KR,
Explore our Alfresco products with the links below. Use labels to filter content by product module.