Oak - No indexes were used. | Community
Skip to main content
Level 3
May 6, 2016

Oak - No indexes were used.

  • May 6, 2016
  • 1 reply
  • 1777 views

Hello,  I'm working with a long running query.  I've used the Query Explanation feature in AEM 6.1 to review my query.  It is not hitting my index.  Any help would be appreciated.

 

 

Query:

[nt:base] as [parent] /* traverse "/content/dam/mw/videos//*" where (isdescendantnode([parent], [/content/dam/mw/videos])) and ([parent].[primaryProduct] = 'product:AT') and ([parent].[asset_language] = 'asset-language:en') */

 

Index A:

<mwRelatedVideos jcr:primaryType="oak:QueryIndexDefinition" propertyNames="[primaryProduct,asset_language]" reindex="{Boolean}false" reindexCount="{Long}5" type="property"/>

Index B:

<mwRelatedVideosIndex jcr:primaryType="oak:QueryIndexDefinition" async="async" compatVersion="{Long}2" reindex="{Boolean}false" reindexCount="{Long}6" type="lucene"> <aggregates jcr:primaryType="nt:unstructured"> <dam:Asset jcr:primaryType="nt:unstructured"> <include0 jcr:primaryType="nt:unstructured" path="jcr:content/metadata/mw/*"/> </dam:Asset> </aggregates> <indexRules jcr:primaryType="nt:unstructured"> <nt:base jcr:primaryType="nt:unstructured"> <properties jcr:primaryType="nt:unstructured"> <primaryProduct jcr:primaryType="nt:unstructured" name="primaryProduct" propertyType="{Boolean}true"/> <asset_language jcr:primaryType="nt:unstructured" name="asset_language" propertyType="{Boolean}true"/> </properties> </nt:base> </indexRules> </mwRelatedVideosIndex>
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

1 reply

smacdonald2008
Level 10
May 6, 2016

Looks like something was not configured properly so that the OAK index was used Wathc this GEMS session on OAK index where they cover how to configure it: 

http://dev.day.com/content/ddc/en/gems/oak-lucene-indexes.html

Hope this helps. 

Lokesh_Shivalingaiah
Level 10
May 9, 2016

Also refer some of the docs [1] [2] to understand about indexes and its configuration

[1] https://docs.adobe.com/docs/en/aem/6-0/deploy/upgrade/queries-and-indexing.html

[2] http://jackrabbit.apache.org/oak/docs/query/lucene.html

bfvaughnAuthor
Level 3
May 9, 2016

So this has helped a lot but I'm still not seeing the index get used.  Looks like the execution plan is using the index.

Indexes Used

No indexes were used.

Execution Plan

[dam:Asset] as [p] /* lucene:mwRelatedVideosIndex(/oak:index/mwRelatedVideosIndex) :ancestors:/content/dam/mw/videos where (isdescendantnode([p], [/content/dam/mw/videos])) and ([p].[jcr:content/metadata/mw/primaryProduct] = 'product:EC') and ([p].[jcr:content/metadata/mw/asset_language] = 'asset-language:de') */