cancel
Showing results for 
Search instead for 
Did you mean: 

How to find node links by luceneSearch

refur
Champ in-the-making
Champ in-the-making
Hi everyone!

I'm trying to find a node of type filelink by lucenSearch, I tried something like this:


search.luceneSearch("(PATH:\"/app:company_home/st:sites/cm:comex-y-logistica/cm:documentLibrary//*\") AND @cm\\:link:\"NP N°1\"");


But it didn't work. I tried too with "cm:name" , "app:linktype" but nothing happened.

What is the correct way to find it?

Regards
4 REPLIES 4

kaynezhang
World-Class Innovator
World-Class Innovator
Try

search.luceneSearch('+PATH:"//app:company_home//st:sites//cm:comex-y-logistica//cm:documentLibrary//*" AND +TYPE:"cm:link"');

refur
Champ in-the-making
Champ in-the-making
Thanks for answer!

It is working, but now i need to find an specific node, not all. How can I do it?

Example:

search.luceneSearch('+PATH:"//app:company_home//st:sites//cm:comex-y-logistica//cm:documentLibrary//cm:'+encode2+'//*" AND +TYPE:"cm:link" AND @cm\\:name:\NP N° '+theNameOfTheDocument+''


But that didn't work. In the repository (share) I see the links by the name "Link to: nameOfDocument". I tried to put that name (Link to..etc" but It didn't work either.

Regards

refur
Champ in-the-making
Champ in-the-making
Ok, I found the correct syntax:
If you create the link by the method "create node" you have to put the same name that you write in the parameters, example:

ruta.createNode(nameOfMyDocument+ " link.url", "{http://www.alfresco.org/model/application/1.0}filelink", pr);


And you can find that node by the next query:

search.luceneSearch('+PATH:"//app:company_home//st:sites//cm:comex-y-logistica//cm:documentLibrary//cm:'+encode2+'//*" AND +TYPE:"cm:link" AND @cm\\:name:\"'+nameOfMyDocument+' link.url"');


Regards

kaynezhang
World-Class Innovator
World-Class Innovator
Good luck,and if you only create file link ,you can use
AND +TYPE:"cm:filelink" 
instead of
 AND +TYPE:"cm:link"