Issues with Queries using sling:resource property | Community
Skip to main content
Deepikaa_Nagesh
Level 3
Apr 29, 2016 9:44 AM UTC
Solved

Issues with Queries using sling:resource property

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.
Accepted solution
May 23, 2016 6:19 AM UTC

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

Peter_Puzanovs
New Participant
Jun 18, 2018 10:06 AM UTC

Hi,

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


Regards,

Peter

Translate
Deepikaa_Nagesh
Level 3
Apr 11, 2017 12:07 PM UTC

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

Translate
Deepikaa_Nagesh
Level 3
Apr 11, 2017 12:05 PM UTC

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

Translate
radhikak8817019
Level 3
Mar 24, 2017 6:42 AM UTC

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,

Translate
Tuhin_Ghosh
Level 8
Nov 14, 2016 8:11 AM UTC

Hi Deepikaa,

 

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

 

Thanks and Regards,

Tuhin

Translate
Accepted solution
May 23, 2016 6:19 AM UTC

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"

            }

          }
        }

      }

    }

  }

Translate
Tuhin_Ghosh
Level 8
May 5, 2016 8:14 AM UTC
        You just need to mark the answer as correct and that should suffice. Thanks Tuhin
Translate
May 5, 2016 8:08 AM UTC

I shall close this with solution provided so that others can refer it.

Also I am nt sure how exactly to close a question here.

Translate
Tuhin_Ghosh
Level 8
May 4, 2016 10:52 PM UTC

Hi Deepika,

Kindly close this ticket then.

Thanks

Tuhin

Translate
Deepikaa_Nagesh
Level 3
May 4, 2016 4:36 PM UTC

Thanks  for the reply Tuhin.

Have raised day care ticket for this.

Translate