Christoph Kiehl
added a comment - 22/Jun/07 11:02 This patch is a prototype for supporting jcr:contains calls that use descendent-or-self-axis as their root:
/foo/bar/* [jcr:contains(//*, term)]
It does not support queries which use descendent-or-self-axis on childnodes:
NOT SUPPORTED: /foo/bar/* [jcr:contains(test//*, term)]
Right now it uses a keyword to recognize descendent-or-self-axis queries:
/foo/bar/* [jcr:contains(DESCENDENT_OR_SELF, term)]
We used to have queries like this:
/foo/bar/* [jcr:contains(., term) or jcr:contains(*, term) or jcr:contains(*/*, term)]
In this construct the term query is executed three times which leads to long execution times whereas the query above is much faster because the term query is only executed once.
This is just a prototype and I would like to know what you think about it. The patch needs better integration with the query builder so that we don't need to use a keyword but can use "//*" instead.

Well, the problem with the current implementation is how the path is stored in the abstract query tree. Because it uses a Path instance in RelationQueryNode other axis than child are not possible currently. The correct solution is probably to replace the Path with a full fledged PathQueryNode. Anything else is rather a hack.

Marcel Reutegger
added a comment - 25/Jun/07 10:46 Well, the problem with the current implementation is how the path is stored in the abstract query tree. Because it uses a Path instance in RelationQueryNode other axis than child are not possible currently. The correct solution is probably to replace the Path with a full fledged PathQueryNode. Anything else is rather a hack.