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: How to get excerpt for child node?
Date Tue, 14 Aug 2007 08:00:40 GMT
lujie wrote:
>   I have such node structure:
>   document
>      --content
>         --attachment
>   if i want to get excerpt for attachment and at the sametime get the
> document node,i 'm using
>   //element(*,document)[jcr:contains(content/attachment,'test
> content')]/rep:excerpt(.)
>  but getting empty excerpt.
>  Any ideas?

that's currently not properly supported but there's some kind of a 'hidden' 
feature in the query result implementation. even though the query selects the 
current node in rep:excerpt(.) you can also retrieve excerpts for descendant items:

QueryResult result = ...;
RowIterator rows = result.getRows();
while (rows.hasNext()) {
   rows.nextRow().getValue("rep:excerpt(content/attachement)").getString();
}

regards
  marcel

Mime
View raw message