On Wed, Sep 15, 2010 at 10:21 AM, shahid.khan <[email protected]> wrote: > > Hi, > > I am using following query to search the jackrabbit repository for file > containing given text. > //element(*, nt:file)[jcr:contains(jcr:content, > 'searchText')]/rep:excerpt(.) > > it works fine for me but it searches the whole repository. > I want to search a subtree in repository for example I want to start > searching under node "/domain/users/user".
you can use /jcr:root/domain/users/user//element(*, nt:file)[jcr:contains(jcr:content,'searchText')]/rep:excerpt(.) Also take a look at jsr-170 the xpath part. It is described there in a just a couple of pages Regards Ard > > Can any body help me on this that how to change the XPATH query to get the > desired result. > > Thanks & Regards > Shahid K. > -- > View this message in context: > http://jackrabbit.510166.n4.nabble.com/XPATH-Query-to-search-subtree-for-nt-file-content-tp2540098p2540098.html > Sent from the Jackrabbit - Users mailing list archive at Nabble.com. >
