Hi!

We are using Jackrabbit JAR (version 2.14.0) within the Sling framework as a 
content repository. For the implementation of a full text search we switch on 
aggregation in the lucene search index such that the subnodes of nodes of type 
cpp:PageContext are aggregated into that node (compare 
https://jackrabbit.apache.org/oak/docs/query/lucene.html#aggregation):

aggregates
    cpp:Page
        include0
            path="*"
        include1
            path="*/*"
and so forth.

A JCR-SQL2 fulltext search like

SELECT excerpt(n) FROM [cpp:PageContent] AS n 
WHERE ISDESCENDANTNODE(n, '/content') AND (CONTAINS(n.*,'searchterm' ) )  

finds nodes of type cpp:PageContent that have the searchterm in their 
attributes and nodes that have the searchterm in the attributes of their 
subnodes, as required by our application. My problem is however, that the 
excerpt (https://wiki.apache.org/jackrabbit/ExcerptProvider) contains something 
if the searchterm is found in the properties of the returned node, but nothing 
when the searchterm is only found in the properties of the subnodes that have 
been aggregated.

Is there anything I can do to retrieve the excerpt for the subnodes without 
traversing the whole (potentially sizeable) hierarchy of each of the several 
returned search results? Is there any special syntax I could use, as 
http://jackrabbit.510166.n4.nabble.com/How-to-get-excerpt-for-child-node-td514886.html
 suggests? (Unfortunately the solution given there does not work for me, since 
I don't know at which subnodes the terms are found, and if there are several 
searchterms these might even be found on different subnodes.) Thanks so much!

Best regards,

Hans-Peter

Reply via email to