Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

SQL2 query related doubt

Avatar

Level 9

1] SELECT * FROM [nt:base] AS page WHERE ISDESCENDANTNODE(page, '/content/abcd') AND page.[cq:lastReplicated] > CAST('2010-02-01T00:00:00.000+02:00' AS DATE) AND   page.[cq:lastReplicated] < CAST('2010-02-07T00:00:00.000+02:00' AS DATE)

The above works absolutely fine in CRXDE Lite-> Tools->Query.

2] Now I want to run the same query, but also want pages under location efgh to be listed. Tried replacing occurence in #1 with this WHERE(ISDESCENDANTNODE(page, '/content/abcd') or ISDESCENDANTNODE(page, '/content/efgh')), but it is not working.

Any pointers will be helpful.

1 Accepted Solution

Avatar

Correct answer by
Level 10

Make sure when you run second time with different path the type in crxde light query editor selected correctly. Or other reason may be repository is corrupted. https://helpx.adobe.com/experience-manager/kb/RepositoryInconsistency.html

View solution in original post

6 Replies

Avatar

Level 10

Hi,

Theoritically it should work. Can you post the error you are seeing here

Avatar

Correct answer by
Level 10

Make sure when you run second time with different path the type in crxde light query editor selected correctly. Or other reason may be repository is corrupted. https://helpx.adobe.com/experience-manager/kb/RepositoryInconsistency.html

Avatar

Level 10

How are you running it - are you running it from within Java within an OSGi bundle? 

Avatar

Level 9

Hi bsloki,

Thank you for your reply.

"Query execution resulted in an error" is all we get. Nothing much was to be seen in the error logs too. Anything specific we need to check here.

Avatar

Level 9

Hi Sham,

Thank you for your reply.

Details as seen below :

-the type in crxde light query editor is the same the second time too.

- A strange thing is if we try with folders 4 level deep it works fine, say WHERE(ISDESCENDANTNODE(page, '/1/2/3/4') or ISDESCENDANTNODE(page, '/5/6/7/8')). Not sure why is this weird behavior observed.

- Also, I guess the repository is fine.

Avatar

Level 10

There are JCR SQL2 issues with the type of query. There may be performance issues with more than 4 levels deep. Not related to AEM. 

Look at Apache docs. Check here for starters:

https://issues.apache.org/jira/browse/JCR-2835