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
Hi,
Can you post the real value used to perform the query?
KR,
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.
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,
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.
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,
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
I don't see any multi-value property in your model.
Can you show us
my:dossierCodes
sample value in node browser?
KR,
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>
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,
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.