Expand my Community achievements bar.

SOLVED

Oak index for jcr:title property

Avatar

Level 2

Hi,

I have this query to get a pagecontent node based on jcr:title property this way:

/jcr:root/content/abc/def/ghi/jkl//element(*, cq:PageContent)[@jcr:title = 'config']

When I run this query, I'm observing following kinda warnings in logs:

org.apache.jackrabbit.oak.plugins.index.property.strategy.ContentMirrorStoreStrategy Traversed 7000 nodes using index jcr:primaryType with filter ......

I created following property index:

declaringNodeTypes    Name[]    cq:PageContent
jcr:primaryType    Name    oak:QueryIndexDefinition
propertyNames    Name[]    jcr:title
reindex    Boolean    FALSE
type    String    propery

But still the query takes a lot of time to execute. Any thoughts on this.

Thanks in advance :)

1 Accepted Solution

Avatar

Correct answer by
Level 2

Use lucene base indexes, you can create a non-root index under /content/abc/oak:index for the property jcr:title, should work and speed up your query.

For that you should have the latest hotfix for AEM 6 (OAK 1.0.11)

https://helpx.adobe.com/experience-manager/kb/aem6-available-hotfixes.html (the fix comes with 2 sampless)

And you should read the Lucene Index docuementation : http://jackrabbit.apache.org/oak/docs/query/lucene.html

View solution in original post

2 Replies

Avatar

Correct answer by
Level 2

Use lucene base indexes, you can create a non-root index under /content/abc/oak:index for the property jcr:title, should work and speed up your query.

For that you should have the latest hotfix for AEM 6 (OAK 1.0.11)

https://helpx.adobe.com/experience-manager/kb/aem6-available-hotfixes.html (the fix comes with 2 sampless)

And you should read the Lucene Index docuementation : http://jackrabbit.apache.org/oak/docs/query/lucene.html