cancel
Showing results for 
Search instead for 
Did you mean: 

PATH not honored in search

shikarishambu
Champ in-the-making
Champ in-the-making
My custom webscript has a parameter "space" that defaults to "/". If a value is passed that is appended to the company_home and I want the search to only look in that folder and ones below. However, it looks like it is not honoring this. I have tried encoding the space parameter in ISO9075Encode, still no luck. It returns all docs in all folders. I am guessing I am missing something trivial/ got the syntax wrong but I can't seem to figure it. please help


//default
var space = "/";

//Pass in reference to company_home. For company_home/Inbox, say Inbox
if ((args.space != "") && (args.space != null))
{
   space = args.space;
}

var query = 'PATH:\"/{http://www.alfresco.org/model/application/1.0}company_home/{http://www.alfresco.org/model/applicatio... search.ISO9075Encode(space)+ '\"+TYPE:\"{http://www.mycustommodel.com/model/content/1.0}doc\"';


1 REPLY 1

hsohaib
Champ on-the-rise
Champ on-the-rise
The problem comes from your Lucene query, company home is a special space ({http://www.alfresco.org/model/application/1.0}company_home) , where as other spaces should be refered as ({http://www.alfresco.org/model/content/1.0}somespace) , so the fellowing query should work for you :


"PATH:\"/app:company_home/cm:"+search.ISO9075Encode(space)+"//*\" AND TYPE:\"{http://www.mycustommodel.com/model/content/1.0}doc\" "