xpath - JCR query to return excerpt and parent identifier -
i query jackrabbit repository on versions have stored.
my repository looks following:
following xpath query works well://element(*, nt:frozennode)[jcr:contains(., '" + keyword + "') ]/rep:excerpt(.)
, row object returned can excerpt found in de:template nodes 'de:content' property (for full-text indexable have own lucene configuration).
the problem is: how know elements excerpt found for, since query returns me path found (/jcr:system/jcr:versionstorage/95/c8/3e/95c83efc-8441-4017-b3af-ae7be49f07e5/1.0/jcr:frozennode/de:template) , excerpt itself.
so know identifier of nt:versionhistory node, stored in jackrabbit.
i have solution well, getting parent nodes until nt:versionhistory reached , getting identifier:
row row = (row) rows.next(); node node = row.getnode(); node frozennode = node.getparent(); node versionnumber = frozennode.getparent(); string versionid = versionnumber.getidentifier();
however takes time , lots of versions bad performance.
therefore, wonder if it's possible include version id in query, such no parent nodes need fetched after query executed.
that's not possible using xpath query. using sql2 using join:
select n.*, excerpt(n), v.[jcr:uuid] [nt:frozennode] n inner join [nt:version] v on isdescendantnode(n,v) contains(n.*,'adobe')
Comments
Post a Comment