I have the following query string:
SELECT jcr:title, jcr:created, jcr:description FROM cq:PageContent WHERE jcr:path LIKE '/content/.../%' AND CONTAINS (., '*') ORDER BY date ASC
The problem is that the query is returning all nodes from the given path even though they don't have asterisk in any proeprty. I wanted to escape the asterisk character, but the result is the same. I've tried something like this:
SELECT jcr:title, jcr:created, jcr:description FROM cq:PageContent WHERE jcr:path LIKE '/content/.../%' AND CONTAINS (., '\*') ORDER BY date ASC
or even something like this:
SELECT jcr:title, jcr:created, jcr:description FROM cq:PageContent WHERE jcr:path LIKE '/content/.../%' AND CONTAINS (., '\*\*\*\*\*\*\*\*\*\*\*') ORDER BY date ASC
In all these queries, the result is the same, even though none of these pages have property which contains the asterisk character (or 11 of them)
The documentation of jcr:contains function says:
Within the searchexp literal instances of single quote (“'”), double quote (“"”) and hyphen (“-”) must be escaped with a backslash (“\”). Backslash itself must therefore also be escaped, ending up as double backslash (“\”).
Other characters like *
are not mentioned so it should work even without any escaping (?). Please let me understand why I'm getting such results here and how to properly escape such chars.