Query Builder multi path search | Community
Skip to main content
Salvatore_Gallo
New Participant
September 19, 2017
Solved

Query Builder multi path search

  • September 19, 2017
  • 7 replies
  • 9024 views

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

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Salvatore_Gallo

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

thank you

7 replies

smacdonald2008
New Participant
September 26, 2017

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

Salvatore_Gallo
Salvatore_GalloAuthorAccepted solution
New Participant
September 26, 2017

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

thank you

Salvatore_Gallo
New Participant
September 20, 2017

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

This is absurd

September 20, 2017

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.

Shubham_borole
New Participant
September 19, 2017

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

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

Using AEM 6.2 SP1

Salvatore_Gallo
New Participant
September 19, 2017

I tested it on the querydebugger.

smacdonald2008
New Participant
September 19, 2017

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