How to find node links by luceneSearch

You are here

5 posts / 0 new
Last post
How to find node links by luceneSearch [Solved]

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?


type search


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

If this post was helpful, please click Yes on the Post Rating

Thanks for answer!

Thanks for answer!

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


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.


Ok, I found the correct

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"');



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

If this post was helpful, please click Yes on the Post Rating

Topic locked
forums index