03-17-2023 05:22 AM
Hi all,
I need to implement an afts query that find all the documents that have a PATH like this:
/app:company_home/st:sites/cm:site1/xxxxx/…/MYCUSTOMFOLDERNAME/xxxxx”
I already used these kind of query before using wildcards like this:
TYPE:"cm:content" AND PATH:"/app:company_home/st:sites/cm:site1/xxxxx/MYCUSTOMFOLDERNAME//*"
but I need that the xxxxx value could be any folder, not a static one (ex. /documentLibrary/AnotherStaticFolder/...).
I tried creating a query like this but I have no results:
TYPE:"cm:content" AND PATH:"/app:company_home/st:sites/cm:site1//*//MYCUSTOMFOLDERNAME//*"
Probably I'm asking an impossible question but I want to know if someone has any suggestion.
Instead of this I already have a workaround where I found all the folder named MYCUSTOMFOLDERNAME and create for each a different query like this:
TYPE:"cm:content" AND ANCESTOR:"EACH-FOLDER-NODEREF-HAVING-MYCUSTOMFOLDERNAME"
Thanks in advance.
03-17-2023 05:42 AM
ANCESTOR is definitively the most performance approach.
Anyway, I've tested this AFTS query and it works for default Alfresco data.
PATH:"/app:company_home/st:sites//*/cm:Presentations//*"
03-17-2023 05:42 AM
ANCESTOR is definitively the most performance approach.
Anyway, I've tested this AFTS query and it works for default Alfresco data.
PATH:"/app:company_home/st:sites//*/cm:Presentations//*"
03-17-2023 06:01 AM
Hi Angel,
thanks for answering my question.
I found out that I added an extra slash ("/")
TYPE:"cm:content" AND PATH:"/app:company_home/st:sites/cm:site1//*//MYCUSTOMFOLDERNAME//*"
That query now is running correctly.
But I've another problem that probably can't be solved.
MYCUSTOMFOLDERNAME is composed like this -> "[id.id.id] FolderName" so I was trying to replace that [id.id.id] with another * like below:
TYPE:"cm:content" AND PATH:"/app:company_home/st:sites/cm:site1//*/*MYCUSTOMFOLDERNAME//*"
This is the real case where I have no results.
Anyway, I know that the ANCESTOR is the best approach if we prioritize our server performance but my query will be necessary only for statistics purposes, so it will be run only few times for year and manually by an admin user.
Explore our Alfresco products with the links below. Use labels to filter content by product module.