FTS Query with PATH wildcards

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

FTS Query with PATH wildcards

Jump to solution

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.

1 Solution

Accepted Solutions
angelborroy
Alfresco Employee

Re: FTS Query with PATH wildcards

Jump to solution

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//*"

 

Hyland Developer Evangelist

View solution in original post

2 Replies
angelborroy
Alfresco Employee

Re: FTS Query with PATH wildcards

Jump to solution

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//*"

 

Hyland Developer Evangelist
prorobin
Active Member

Re: FTS Query with PATH wildcards

Jump to solution

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.