Hello everybody,
We currently got an issue in our instance of AEM. We are currently on AEM 6.4.8.1.
Today to get some data we make a request in our code :
SELECT * FROM [nt:base] WHERE ISDESCENDANTNODE('/etc/commerce/nicephore/catalog/MSegment') AND [cnp:type] = 'Parfums'
When we execute the query through the crx we got some results, it's okay. However today when we execute the query through the code the result is 0, we don't have any result.
We have currently an index for the property cnp:type and we already reindex it but it didn't change anything. We already checked the acl and right and this is not the issue. We don't understand why the same executed query (in crx and in our code) send us different result. We don't have any logs when the query is called.
Here is the code we use to make the query :
Session session = resourceResolver.adaptTo(Session.class);
queryManager = session.getWorkspace().getQueryManager();
StringBuilder queryStrLigne = new StringBuilder("SELECT * FROM [nt:base] WHERE ISDESCENDANTNODE('" + COMMERCE_SEGMENT + "') AND [cnp:type] = 'Parfums'");
Query queryAsset = queryManager.createQuery(queryStrLigne.toString(), Query.JCR_SQL2);
QueryResult result = queryAsset.execute();
What could cause this issue ? If you have any idea it would help a lot.
Thank you.