Issues with Queries using sling:resource property | Community
Skip to main content
Deepikaa_Nagesh
Level 3
April 29, 2016
Solved

Issues with Queries using sling:resource property

  • April 29, 2016
  • 16 replies
  • 9248 views

hi,

We are using aem 6.1 with oak version 1.2.7.

We see lot of traversal warnings for queries which use sling:resource property. Mostly these queries have paths for assets. Not sure when exactly this query is triggered by AEM.

There is already OOB oak property index available for sling:resource property but still these queries give warnings.

Sample Query

13.04.2016 10:41:31.328 *WARN* [pool-11-thread-5-<main queue>(com/adobe/cq/collection/update/job)] org.apache.jackrabbit.oak.plugins.index.property.strategy.ContentMirrorStoreStrategy Traversed 10000 nodes (15345 index entries) using index slingResource with filter Filter(query=select [jcr:path], [jcr:score], * from [nt:unstructured] as a where [sling:resource] like '/content/dam/cxxc/yyy/xxx/yy/1860x1050-fm-D11C-330-370-410-450.png%' and isdescendantnode(a, '/content/dam') /* xpath: /jcr:root/content/dam//element(*, nt:unstructured)[jcr:like(@sling:resource, '/content/dam/cxxc/yyy/xxx/yy/1860x1050-fm-D11C-330-370-410-450.png%')] */, path=/content/dam//*, property=[sling:resource=[[/content/dam/cxxc/yyy/xxx/yy/1860x1050-fm-D11C-330-370-410-450.png.., ../content/dam/cxxc/yyy/xxx/yy/1860x1050-fm-D11C-330-370-410-450.pnh]]])

These warnings are causing performance issues in author.

Thanks,

Deepikaa

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

Solution for this particular issue is to have lucene property index.Not sure why existing oak property index didnt work.We had to disable it and put in lucene property index as shown below

 

"slingResourceLucene": {

    "jcr:primaryType": "oak:QueryIndexDefinition",

    "compatVersion": 2,

    "type": "lucene",

    "async": "async",

    "reindex": false,

    "reindexCount": 1,

    "indexRules": {

      "jcr:primaryType": "nt:unstructured",

      "nt:unstructured": {

        "jcr:primaryType": "nt:unstructured",

        "properties": {

          "jcr:primaryType": "nt:unstructured",

          "slingResource": {

            "jcr:primaryType": "nt:unstructured",

            "propertyIndex": true,

            "name": "sling:resource"

            }

          }
        }

      }

    }

  }

16 replies

Accepted solution
May 23, 2016

Solution for this particular issue is to have lucene property index.Not sure why existing oak property index didnt work.We had to disable it and put in lucene property index as shown below

 

"slingResourceLucene": {

    "jcr:primaryType": "oak:QueryIndexDefinition",

    "compatVersion": 2,

    "type": "lucene",

    "async": "async",

    "reindex": false,

    "reindexCount": 1,

    "indexRules": {

      "jcr:primaryType": "nt:unstructured",

      "nt:unstructured": {

        "jcr:primaryType": "nt:unstructured",

        "properties": {

          "jcr:primaryType": "nt:unstructured",

          "slingResource": {

            "jcr:primaryType": "nt:unstructured",

            "propertyIndex": true,

            "name": "sling:resource"

            }

          }
        }

      }

    }

  }

Tuhin_Ghosh
Level 8
November 14, 2016

Hi Deepikaa,

 

Was this solution given by Adobe ? If yes what was the rationale provided?

 

Thanks and Regards,

Tuhin

radhikak8817019
Level 3
March 24, 2017

Hi Deepika,

I am also facing the same issue. Could you please share your findings if your issue is resolved?

Any pointers would be highly appreciated.

Thanks,

Deepikaa_Nagesh
Level 3
April 11, 2017

Hi Tuhin, 

 

Sorry for very delayed response. Yes this was given by Adobe.

This was the reason given by Adobe Support ,

, lets disable sling:Resource property index at oak:index/slingResource as I can see in your query string its searching using jcr:like over the property sling:Resource. Hence, lets disable from oak:index/slingResource and add these property under oak:index/lucene/nt:base like I have mentioned. To disable oak:index/slingResource change the type property value to disable.

There is caution note, if we see the oak:index/slingResource indexes are needed in future then we have enable it as either of one would be picked based on the cost and oak:index/slingResource would have less cost over the lucene one. 

Thanks,

Deepikaa

Deepikaa_Nagesh
Level 3
April 11, 2017

RadhikaKush wrote...

Hi Deepika,

I am also facing the same issue. Could you please share your findings if your issue is resolved?

Any pointers would be highly appreciated.

Thanks,

 

Hi Radhika,

If you have the same issue,did you try putting the lucene index as stated above?

could you please post the warning you get so that i can say if this one index will serve your query.

Thanks,

Deepikaa

Peter_Puzanovs
Community Advisor
Community Advisor
June 18, 2018

Hi,

Does anyone know's DayCare/Engineering ticket number related to this issue?


Regards,

Peter