cancel
Showing results for 
Search instead for 
Did you mean: 

searching by uuid problem

spilby
Confirmed Champ
Confirmed Champ
I'm trying to search a node by the uuid, but don't works.

This is my query:



PATH: "//app:company_home/app:user_homes/cm:APG//." AND @sys\:node-uuid:"9c7e7c6c-f729-4aff-98ed-8e2ff0ceaf85"


And my code for the search:

SearchParameters sp = new SearchParameters();
sp.addStore(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE);
sp.setLanguage(SearchService.LANGUAGE_LUCENE);
sp.setQuery(query);
ResultSet results = getSearchService().query(sp);

What's wrong in my query?

I can see in the properties that exists:

{http://www.alfresco.org/model/system/1.0}node-uuid=9c7e7c6c-f729-4aff-98ed-8e2ff0ceaf85

Thanks!
3 REPLIES 3

kaynezhang
World-Class Innovator
World-Class Innovator
You can use ID field ,like below

PATH: "//app:company_home/app:user_homes/cm:APG//." AND ID:workspace\://SpacesStore/9c7e7c6c-f729-4aff-98ed-8e2ff0ceaf85

mrogers
Star Contributor
Star Contributor
@sys\:node-uuid:9c7e7c6c-f729-4aff-98ed-8e2ff0ceaf85

should work

spilby
Confirmed Champ
Confirmed Champ
Oks! Now works! Was a problem with the " character. This query works perfectly. Thanks! Smiley Surprised)


String queryLucene = "PATH: \"/" +path+"//.\"" + " AND @sys\\:node-uuid:\""+uuid+"\"" + " AND TYPE:\""+documentType+"\"";