Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.
SOLVED

Query Builder multi path search

Avatar

Level 2

Why the following query

type=cq:Page

1_group.1_path=/content/we-retail/it

1_group.2_path=/content/we-retail/fr

1_group.3_path=/content/we-retail/us

1_group.p.or=true

orderby=@jcr:lastModified

orderby.sort=desc

produce this error:

Could not run xpath query

javax.jcr.query.InvalidQueryException: java.text.ParseException: (/jcr:root/content/we-retail/it//element(*, cq:Page) | /jcr:root/content/we-retail/fr//element(*, cq:Page) | /jcr:root/content/we-retail/us//element(*, cq:Page)) order by @jcr:lastModified descending converted to SQL-2 Query: select [jcr:path], [jcr:score], * from [cq:Page] as a where isdescendantnode(a, '/content/we-retail/it') /* xpath: /jcr:root/content/we-retail/it//element(*, cq:Page)  order by @jcr:lastModified descending */ union select [jcr:path], [jcr:score], * from [cq:Page] as a where isdescendantnode(a, '/content/we-retail/fr') /* xpath: /jcr:root/content/we-retail/fr//element(*, cq:Page)  order by @jcr:lastModified descending */ order by [jcr:lastModified] desc union(*)select [jcr:path], [jcr:score], * from [cq:Page] as a where isdescendantnode(a, '/content/we-retail/us') /* xpath: /jcr:root/content/we-retail/us//element(*, cq:Page) order by @jcr:lastModified descending */ order by [jcr:lastModified] desc; expected: <end>

NB: if I remove a path the query is successfully executed. If I remove the orderBy and leave the three paths the query is successfully executed, but naturally the results are not ordered.

Please help me.

Thanks

1 Accepted Solution

Avatar

Correct answer by
Level 2

The problem was resolved by installing hotfix aem-6.3.0-cfp-1.0.zip

thank you

View solution in original post

7 Replies

Avatar

Level 10

How are you executing this Query - from CRXDE or from Java code?

Avatar

Community Advisor

I just copied your query and ran it on Query Builder Debugger. I was able to see results (129 hits..)

1302246_pastedImage_0.png

http://localhost:4502/libs/cq/search/content/querydebug.html?_charset_=UTF-8&query=type%3Dcq%3APage%...

Using AEM 6.2 SP1

Avatar

Former Community Member

I also have the same problem in aem 6.3. In aem 6.2 works correctly. I tested it in querydebugger and in java code.

Avatar

Level 2

I use the 6.3.
I checked on 6.2 is working.

This is absurd

Avatar

Correct answer by
Level 2

The problem was resolved by installing hotfix aem-6.3.0-cfp-1.0.zip

thank you

Avatar

Level 10

Thanks for posting the fix! This will be helpful to future inquires on this issue.