0

I tried to execute following queries in cq search jsp. It is throwing

Error: javax.jcr.query.InvalidQueryException: Encountered "["

http://localhost:4502/crx/explorer/ui/search.jsp

SELECT * FROM cq:Component WHERE ISDESCENDANTNODE([/apps]) ORDER BY lower(jcr:title)

SELECT * FROM [cq:Component] AS c WHERE ISDESCENDANTNODE([/apps]) ORDER BY lower(c.[jcr:title])

Any ideas ?

Sri
  • 1,205
  • 2
  • 21
  • 52

1 Answers1

1

The form you linked to seems to be using JCR SQL. The format of your query looks like JCR SQL2

Your second query works just fine when interpreted as JCR SQL2 in the Query tool in CRXDE.

enter image description here

http://localhost:4502/crx/explorer/ui/search.jsp does not seem to allow JCR SQL2 to be selected and the syntax you're using is not supported in JCR SQL.

The condition, when expressed in JCR SQL, should have the following format:

where jcr:path like '/apps/%'

But I don't think there's a good reason to use JCR SQL when JCR SQL2 is available.

toniedzwiedz
  • 17,895
  • 9
  • 86
  • 131