Expand my Community achievements bar.

Oak - No indexes were used.

Avatar

Level 3

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>
3 Replies

Avatar

Level 10

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. 

Avatar

Level 3

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') */