cancel
Showing results for 
Search instead for 
Did you mean: 

Search a node based on the Node id.

prateekgoyal
Champ in-the-making
Champ in-the-making
Hello Everyone,

I want to know that is it possible to search a node on the bases of its node id. If possible then how can we do it.
Please help

Thanks,
4 REPLIES 4

mrogers
Star Contributor
Star Contributor
There's no need to search.

If you have the node id you can access the node directly.

tgmweb
Champ in-the-making
Champ in-the-making
if you want to get the node, just do:
var node = utils.getNodeFromString(nodeRef);

prateekgoyal
Champ in-the-making
Champ in-the-making
hey thanks for the rply… but i didnt get the solution you have provided…can you please elaborate the solution…

Thanks,

bramthielemans
Champ in-the-making
Champ in-the-making
NodeRef ref = new NodeRef(<noderef>);

and then check if it exists. Or a lucene query like:

ID:<noderef>