JCR Query - Search for two components under a parent | Community
Skip to main content
Singaiah_Chintalapudi
Level 7
January 16, 2019

JCR Query - Search for two components under a parent

  • January 16, 2019
  • 1 reply
  • 17270 views

Hi,

I am trying to find the query to extract all the pages which has two components in it. I wrote the query to extract a single component but having trouble to write the query to pull the pages which has both components.

Any help would be appreciated.

Thanks.

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

1 reply

Gaurav-Behl
Level 10
January 17, 2019

Do you plan to use this query in source code or run it via /crx/de? Based on the use case, it would be easy to figure out if you need SQL2, XPATH or you could use QB etc.

How deep in the hierarchy level these components are configured in node structure?  It's easy to look at just 2 node levels but if you want to go deep then it could become slightly complex and you might have to use APIs rather than native queries.

Singaiah_Chintalapudi
Level 7
January 17, 2019

I am planning to execute it via crx/de. I don't think it makes much difference.

Our hierarchy is very deep probably 10 levels deep.

smacdonald2008
Level 10
January 17, 2019

WHen using Querybuilder - you can specify your path. What is your query now?

I recommend using QueryBuilder for this query - Query Builder API