cancel
Showing results for 
Search instead for 
Did you mean: 

Is this correct syntax to query for content by path and name

jcblitz
Champ in-the-making
Champ in-the-making
I have content that is located at Company Home > Pathology Reports and the name is 1234_WS_FTP2.LOG. I'm trying to query for it by including the path as well as the name since the name might not be unique, but the path and name are.  So the query I've come up with is

PATH:"/app:company_home/cm:Pathology_x0020_Reports/@{http://www.alfresco.org/model/content/1.0}name:1234_WS_FTP2.LOG"

The problem is the name of the row that is returned is "Pathology Reports", not the actual content. Is that normal or should I be expecting to be returned the content? Is it a matter of my query not being correct/specific enough?
2 REPLIES 2

jcblitz
Champ in-the-making
Champ in-the-making
I've been reading through http://wiki.alfresco.com/wiki/Search and have tried a few things. I cut/pasted what I thought was really similar to what I wanted just to see what it would return and I get "{http://www.alfresco.org/ws/service/repository/1.0}RepositoryFault:<ns1:errorCode>0</ns1:errorCode><ns1:message>org.alfresco.repo.search.SearcherException: Failed to parse query: +PATH:&quot;/cm:generalclassifiable/cmSmiley Frustratedoftware_x0020_Document_x0020_Classification/member&quot;+@cm\:title:&quot;banana&quot;+PATH:&quot;/sys:user//*&quot;&quot;</ns1:message>"

Is that normal? I know none of that data exists, but shoudln't it get passed the parsing part?

I got the query from http://wiki.alfresco.com/wiki/Search#Combined_Queries

String queryValue = "+PATH:\"/cm:generalclassifiable/cm:Software_x0020_Document_x0020_Classification/member\""+
"+@cm\\:title:\"banana\""+
"+PATH:\"/sys:user//*\"\"";
query = new Query(Constants.QUERY_LANG_LUCENE, queryValue);

andy
Champ on-the-rise
Champ on-the-rise
Hi

It looks liek there are two quotes at the end of the second PATH \"\" should be just \".

Andy