Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

oak index creating issue in AEM6.5.5

bilal_ahmad
Level 5
Level 5

Dear community members,

I have couple of custom index definitions and they are inside the /oak:index content.xml. Here is how one of them being included in my project :

<myCustomLuceneIndex jcr:primaryType="oak:QueryIndexDefinition" async="async" compatVersion="{Decimal}2" 
excludedPaths="[/content/myApp/sites/en-us/system-pages,/content/myApp/sites/en-us/miscellaneous" 
excludePropertyNames="[cq:lastModifiedBy,jcr:createdBy,cq:lastReplicatedBy,jcr:lastModifiedBy]" 
dexPath="/oak:index/myCustomLuceneIndex" includePropertyTypes="[String,Binary]"
reindex="{Boolean}false" reindexCount="{Long}2" type="lucene">
<indexRules jcr:primaryType="nt:unstructured">
<nt:base jcr:primaryType="nt:unstructured"
includePropertyTypes="[String,Binary]">
<properties jcr:primaryType="nt:unstructured">
<allProps jcr:primaryType="nt:unstructured"
isRegexp="{Boolean}true" name=".*"
nodeScopeIndex="{Boolean}true"/>
</properties>
</nt:base>
</indexRules>
</myCustomLuceneIndex>

 I have added this is /filter .xml like this :

<filter root="/oak:index/myCustomLuceneIndex"/>

This works completely fine with AEM 6.4.4 but when I install this along with the build in AEM 6.5.5, seems like the engine gets stuck somehow and not being able to recover at all(even after AEM restart, or system restart).

I actually checked the logs, and I couldn't find anything about it(not even 54% completed or something like that messages that says that re-indexing is in progress). As soon as I comment the oak_index .content.xml and the line in filter.xml, everything works great.

 

Why is this happening? is this way not recommended? or am I doing something wrong?

 

Thanks,

Bilal.

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

6.5
1 Accepted Solution
Vijayalakshmi_S
Correct answer by
Community Advisor
Community Advisor

Hi @bilal_ahmad,

Custom index definition you have shared has few properties that are incorrect as highlighted below. 

  • compatVersion should be of type "Long"
  • excludePropertyNames is not applicable for lucene index definition (on the index node - myCustomLuceneIndex)
  • dexPath is not applicable. Instead property named "indexPath" should be used for mentioning the index path
  • includePropertyTypes is not applicable on the index node. Instead on the specific indexRules (Eg : In this case, it is on nt:base node)

Also this definition will index all nodes(nt:base) -> all props. (nt:base is the super node type for all existing node types and hence the entire nodes in repo)

Based on the repo volume it is taking quite long to index all. That's why you see message related to the progress in percent and it is still in progress. 

 

Next Steps:

  • Per 6.5.0, /oak:index/lucene this covers the indexing for nt:base node type (but is marked as deprecated with help of property). Check if this is still available in 6.5.5 or any new equivalent is available to cover nt:base node type OOB.
  • Remove custom definition from your code base. (Per the definition you have shared, except for the excludedPaths property which has project specific paths, everything looks similar to OOB definition)
  • Analyze the existing OOB definition on 6.5.5 related to nt:base and then decide to create custom only if it is really needed. 

View solution in original post

3 Replies
Vijayalakshmi_S
Correct answer by
Community Advisor
Community Advisor

Hi @bilal_ahmad,

Custom index definition you have shared has few properties that are incorrect as highlighted below. 

  • compatVersion should be of type "Long"
  • excludePropertyNames is not applicable for lucene index definition (on the index node - myCustomLuceneIndex)
  • dexPath is not applicable. Instead property named "indexPath" should be used for mentioning the index path
  • includePropertyTypes is not applicable on the index node. Instead on the specific indexRules (Eg : In this case, it is on nt:base node)

Also this definition will index all nodes(nt:base) -> all props. (nt:base is the super node type for all existing node types and hence the entire nodes in repo)

Based on the repo volume it is taking quite long to index all. That's why you see message related to the progress in percent and it is still in progress. 

 

Next Steps:

  • Per 6.5.0, /oak:index/lucene this covers the indexing for nt:base node type (but is marked as deprecated with help of property). Check if this is still available in 6.5.5 or any new equivalent is available to cover nt:base node type OOB.
  • Remove custom definition from your code base. (Per the definition you have shared, except for the excludedPaths property which has project specific paths, everything looks similar to OOB definition)
  • Analyze the existing OOB definition on 6.5.5 related to nt:base and then decide to create custom only if it is really needed. 

View solution in original post

bilal_ahmad
Level 5
Level 5
Thanks ton! @Vijayalakshmi_S, I'll give this a try and update this space. Also, I pasted it wrong, it's 'indexPath' but while pasting it here, I messed up a little(pasted 'dexPath') 😉
Jörg_Hoh
Employee
Employee
Additionally I would recommend you to consider the use of the EnsureOakIndex feature of ACS AEM Commons. It's developed to apply the index only if it has changed.