Description
This is the same issue raised here:
https://issues.apache.org/jira/browse/JCR-3159
However, it doesn't appear to be fixed. getNodeLocalNameQuery method of LuceneQueryFactory throws an UnsupportedRepositoryOperationException (see stack trace below).
The reason appears to be that this method is coded to only allow TRANSFORM_NONE. Commenting out this check and the query works as expected.
Query:
SELECT * FROM [nt:base] as t where (LOWER(localname(t)) like '%test%' OR contains(t.*, 'test')) AND ISDESCENDANTNODE('/2/8/.documents')
Stack trace:
Caused by: javax.jcr.UnsupportedRepositoryOperationException
at org.apache.jackrabbit.core.query.lucene.LuceneQueryFactory.getNodeLocalNameQuery(LuceneQueryFactory.java:675)
at org.apache.jackrabbit.core.query.lucene.LuceneQueryFactory.getComparisonQuery(LuceneQueryFactory.java:627)
at org.apache.jackrabbit.core.query.lucene.LuceneQueryFactory.create(LuceneQueryFactory.java:430)
at org.apache.jackrabbit.core.query.lucene.LuceneQueryFactory.addBooleanConstraint(LuceneQueryFactory.java:556)
at org.apache.jackrabbit.core.query.lucene.LuceneQueryFactory.getOrQuery(LuceneQueryFactory.java:532)
at org.apache.jackrabbit.core.query.lucene.LuceneQueryFactory.create(LuceneQueryFactory.java:422)
at org.apache.jackrabbit.core.query.lucene.LuceneQueryFactory.mapConstraintToQueryAndFilter(LuceneQueryFactory.java:409)
at org.apache.jackrabbit.core.query.lucene.LuceneQueryFactory.mapConstraintToQueryAndFilter(LuceneQueryFactory.java:359)
at org.apache.jackrabbit.core.query.lucene.LuceneQueryFactory.execute(LuceneQueryFactory.java:210)
at org.apache.jackrabbit.core.query.lucene.join.QueryEngine.execute(QueryEngine.java:465)
at org.apache.jackrabbit.core.query.lucene.join.QueryEngine.execute(QueryEngine.java:126)
at org.apache.jackrabbit.core.query.lucene.join.QueryEngine.execute(QueryEngine.java:115)
at org.apache.jackrabbit.core.query.QueryObjectModelImpl$2.perform(QueryObjectModelImpl.java:129)
at org.apache.jackrabbit.core.query.QueryObjectModelImpl$2.perform(QueryObjectModelImpl.java:124)
at org.apache.jackrabbit.core.session.SessionState.perform(SessionState.java:216)
at org.apache.jackrabbit.core.query.QueryObjectModelImpl.execute(QueryObjectModelImpl.java:123)