Smart Folder Template query with multiple values property

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Active Member II

Smart Folder Template query with multiple values property

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

 

9 Replies
Highlighted
Senior Member

Re: Smart Folder Template query with multiple values property

Hi,

Can you post the real value used to perform the query?

 

KR,

Highlighted
Active Member II

Re: Smart Folder Template query with multiple values property

The real value of my:dossierCodes is the array: ["1234", "4321"].

If I try to do this query:

+TYPE:"my:dossierType" AND =my:dossierCodeSmiley Sad"1234" OR "4321")

I get 3 nodes.

 

Highlighted
Senior Member

Re: Smart Folder Template query with multiple values property

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,

Highlighted
Active Member II

Re: Smart Folder Template query with multiple values property

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.

 

 

 

 

Highlighted
Senior Member

Re: Smart Folder Template query with multiple values property


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,

Active Member II

Re: Smart Folder Template query with multiple values property


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:

  1. Called First, with my:dossierType and my:dossierCode:"1234"
  2. Called Second, with my:dossierType and my:dossierCode:"4321"
  3. Called View, a cm:folder the aspect my:dossierViewAspect and my:dossierCodes:["1234","4321"]

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

 

Highlighted
Senior Member

Re: Smart Folder Template query with multiple values property

I don't see any multi-value property in your model.

Can you show us 

my:dossierCodes

sample value in node browser?

 

KR,

Highlighted
Active Member II

Re: Smart Folder Template query with multiple values property

So sorry!!!

I missed it doing copy/paste  Man Sad

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>
Highlighted
Senior Member

Re: Smart Folder Template query with multiple values property

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,