com.day.cq.search.impl.builder.QueryImpl Could not run xpath query
Hello all
Any help appreciated. The below query runs without issue on 6.1, but throws javax.jcr.query.InvalidQueryException: java.text.ParseException on 6.3.
The cause could not be missing content could it?
Has there been a breaking change in the query builder implementation?
(/jcr:root/content/suninternational//element(*, cq:Page)[(jcr:content/@cq:template = '/apps/suninternational/templates/specialOffersPage') and ((jcr:content/@startDate >= xs:dateTime('2017-10-05T00:00:00.000+02:00')))] | /jcr:root/content/suninternational//element(*, cq:Page)[(jcr:content/@cq:template = '/apps/suninternational/templates/specialOffersPage') and ((jcr:content/@startDate < xs:dateTime('2017-10-05T00:00:00.000+02:00')) and (jcr:content/@endDate >= xs:dateTime('2017-10-05T00:00:00.000+02:00')))] | /jcr:root/content/suninternational//element(*, cq:Page)[(jcr:content/@cq:template = '/apps/suninternational/templates/eventPage') and ((jcr:content/@startDate >= xs:dateTime('2017-10-05T00:00:00.000+02:00')))] | /jcr:root/content/suninternational//element(*, cq:Page)[(jcr:content/@cq:template = '/apps/suninternational/templates/eventPage') and ((jcr:content/@startDate < xs:dateTime('2017-10-05T00:00:00.000+02:00')) and (jcr:content/@endDate >= xs:dateTime('2017-10-05T00:00:00.000+02:00')))] | /jcr:root/content/suninternational//element(*, cq:Page)[(jcr:content/@cq:template = '/apps/suninternational/templates/promotionPage') and ((jcr:content/@startDate >= xs:dateTime('2017-10-05T00:00:00.000+02:00')))] | /jcr:root/content/suninternational//element(*, cq:Page)[(jcr:content/@cq:template = '/apps/suninternational/templates/promotionPage') and ((jcr:content/@startDate < xs:dateTime('2017-10-05T00:00:00.000+02:00')) and (jcr:content/@endDate >= xs:dateTime('2017-10-05T00:00:00.000+02:00')))]) order by jcr:content/@startDate converted to SQL-2 Query: select [jcr:path], [jcr:score], * from [cq:Page] as a where [jcr:content/cq:template] = '/apps/suninternational/templates/specialOffersPage' and [jcr:content/startDate] >= cast('2017-10-05T00:00:00.000+02:00' as date) and isdescendantnode(a, '/content/suninternational') /* xpath: /jcr:root/content/suninternational//element(*, cq:Page)[(jcr:content/@cq:template = '/apps/suninternational/templates/specialOffersPage') and ((jcr:content/@startDate >= xs:dateTime('2017-10-05T00:00:00.000+02:00')))] order by jcr:content/@startDate */ union select [jcr:path], [jcr:score], * from [cq:Page] as a where [jcr:content/cq:template] = '/apps/suninternational/templates/specialOffersPage' and [jcr:content/startDate] < cast('2017-10-05T00:00:00.000+02:00' as date) and [jcr:content/endDate] >= cast('2017-10-05T00:00:00.000+02:00' as date) and isdescendantnode(a, '/content/suninternational') /* xpath: /jcr:root/content/suninternational//element(*, cq:Page)[(jcr:content/@cq:template = '/apps/suninternational/templates/specialOffersPage') and ((jcr:content/@startDate < xs:dateTime('2017-10-05T00:00:00.000+02:00')) and (jcr:content/@endDate >= xs:dateTime('2017-10-05T00:00:00.000+02:00')))] order by jcr:content/@startDate */ order by [jcr:content/startDate] union(*)select [jcr:path], [jcr:score], * from [cq:Page] as a where [jcr:content/cq:template] = '/apps/suninternational/templates/eventPage' and [jcr:content/startDate] >= cast('2017-10-05T00:00:00.000+02:00' as date) and isdescendantnode(a, '/content/suninternational') /* xpath: /jcr:root/content/suninternational//element(*, cq:Page)[(jcr:content/@cq:template = '/apps/suninternational/templates/eventPage') and ((jcr:content/@startDate >= xs:dateTime('2017-10-05T00:00:00.000+02:00')))] order by jcr:content/@startDate */ order by [jcr:content/startDate] union select [jcr:path], [jcr:score], * from [cq:Page] as a where [jcr:content/cq:template] = '/apps/suninternational/templates/eventPage' and [jcr:content/startDate] < cast('2017-10-05T00:00:00.000+02:00' as date) and [jcr:content/endDate] >= cast('2017-10-05T00:00:00.000+02:00' as date) and isdescendantnode(a, '/content/suninternational') /* xpath: /jcr:root/content/suninternational//element(*, cq:Page)[(jcr:content/@cq:template = '/apps/suninternational/templates/eventPage') and ((jcr:content/@startDate < xs:dateTime('2017-10-05T00:00:00.000+02:00')) and (jcr:content/@endDate >= xs:dateTime('2017-10-05T00:00:00.000+02:00')))] order by jcr:content/@startDate */ order by [jcr:content/startDate] union select [jcr:path], [jcr:score], * from [cq:Page] as a where [jcr:content/cq:template] = '/apps/suninternational/templates/promotionPage' and [jcr:content/startDate] >= cast('2017-10-05T00:00:00.000+02:00' as date) and isdescendantnode(a, '/content/suninternational') /* xpath: /jcr:root/content/suninternational//element(*, cq:Page)[(jcr:content/@cq:template = '/apps/suninternational/templates/promotionPage') and ((jcr:content/@startDate >= xs:dateTime('2017-10-05T00:00:00.000+02:00')))] order by jcr:content/@startDate */ order by [jcr:content/startDate] union select [jcr:path], [jcr:score], * from [cq:Page] as a where [jcr:content/cq:template] = '/apps/suninternational/templates/promotionPage' and [jcr:content/startDate] < cast('2017-10-05T00:00:00.000+02:00' as date) and [jcr:content/endDate] >= cast('2017-10-05T00:00:00.000+02:00' as date) and isdescendantnode(a, '/content/suninternational') /* xpath: /jcr:root/content/suninternational//element(*, cq:Page)[(jcr:content/@cq:template = '/apps/suninternational/templates/promotionPage') and ((jcr:content/@startDate < xs:dateTime('2017-10-05T00:00:00.000+02:00')) and (jcr:content/@endDate >= xs:dateTime('2017-10-05T00:00:00.000+02:00')))] order by jcr:content/@startDate */ order by [jcr:content/startDate]
Thanks