jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marcel Reutegger <marcel.reuteg...@gmx.net>
Subject Re: XPath expression leeds to NPE in QueryParser
Date Tue, 01 Jul 2008 07:56:47 GMT
ThorstenL wrote:
>  I'm currently trying with to write my first non trivial queries with XPath.
> So I'm not too sure, if I misunderstand something completely wrong, or
> if there is something broken.
> 
>  This is my current candidates:
> 
> //*[@jcr:primaryType='nt:file'][*//text()[jcr:like(.,'%Dokument%')]]

would the following work for you?

//element(*, nt:file)[jcr:contains(jcr:content, 'Dokument')]

it assumes that your files have an nt:resource child node named jcr:content.

remarks:
- element(*, nt:file) also returns node with a subtype of nt:file
- jcr:contains() is more efficient than jcr:like for longer strings and you
   actually want to do a fulltext search

regards
  marcel

Mime
View raw message