Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

Query Builder multi path search

Salvatore_Gallo
Level 2
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
Salvatore_Gallo
Correct answer by
Level 2
Level 2

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

thank you

View solution in original post

0 Replies
smacdonald2008
Level 10
Level 10

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

Shubham_borole
Community Advisor
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

lucagiuliani
Level 1
Level 1

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.

Salvatore_Gallo
Level 2
Level 2

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

This is absurd

Salvatore_Gallo
Correct answer by
Level 2
Level 2

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

thank you

View solution in original post

smacdonald2008
Level 10
Level 10

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