Custom index in AEMaaCS environment appeared like it might be causing problem with OOTB query, but updating the index didn't fix it | Community
Skip to main content
Level 4
November 8, 2024
Solved

Custom index in AEMaaCS environment appeared like it might be causing problem with OOTB query, but updating the index didn't fix it

  • November 8, 2024
  • 2 replies
  • 2046 views

We have a custom index we created to address some specific needs for searching Content Fragments. We noticed a side effect where the Content Fragment browser stopped showing fragments on the initial screen.

 

 

Digging in to Splunk when the browser attempts to load this screen it makes the following OOTB query that fails on the backend. 

 

 

This is that query. 

 

SELECT asset.* FROM [dam:Asset] AS asset WHERE asset.[jcr:content/contentFragment] = true AND asset.[jcr:content/data/cq:model] IS NOT NULL AND ISDESCENDANTNODE(asset, '/content/dam') ORDER BY COALESCE(asset.[jcr:content/jcr:lastModified], asset.[jcr:created]) DESC, asset.[jcr:uuid] OPTION (TRAVERSAL FAIL, INDEX TAG[fragments])

 

Now I'm suspecting this may be caused by a custom index that is a customization of "fragments". We used the "fragments" tag and we believe that could be the cause. AEM attempts to use our custom index with the tag[fragments]" clause and our custom index isn't setup to work for that query". So we updated the index on a lower environment to no longer use the "fragments" tag as part of its definition, but the query is still failing. Is there something else we need to do here? Do we need to dummy out that custom index? Can we recreate a custom index after dummying it out? Do we need to trigger a reindex of "fragments" (currently "fragments-11"). 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by konstantyn_diachenko

Konstantyn,

 

Something I'm unclear on here is if there's any way to completely remove this customization or if it has to be basically a copy of the originally fragments-10. Do you know?

Preston


Hi @preston-3,

 

Recently I successfully removed OOTB index customization just by removing it from the project. I removed index definition from /apps/_oak_index/.content.xml and removed filter from META-INF/vault/filter.xml.

Official documentation says:

A customized index may be removed in a later version of the customer application, by removing it from the customer repository. An index which is removed from the repository is not used for queries in AEM although it might still be present in the instances for a while. There is a clean-up mechanism in place that runs periodically which cleans up older versions of indexes from the instances.

 

Best regards,

Kostiantyn Diachenko.

2 replies

konstantyn_diachenko
Community Advisor
Community Advisor
November 8, 2024

Hi @preston-3 ,

 

Official doc says:


Introducing new indexes on the dam:Asset nodetype (particularly fulltext indexes) is strongly discouraged as these can conflict with OOTB product features leading to functional and performance issues. In general, adding additional properties to the current damAssetLucene-* index version is the most appropriate way to index queries on the dam:Asset nodetype (these changes will automatically be merged into a new product version of the index if it is subseqently released). If in doubt, contact Adobe Support for advice.

So, I would suggest to extend OOTB index damAssetLucene-11 (this is latest version). Steps how to do this: https://experienceleague.adobe.com/en/docs/experience-manager-cloud-service/content/operations/indexing#deploying-custom-index-definitions 

Kostiantyn Diachenko, Community Advisor, Certified Senior AEM Developer, creator of free AEM VLT Tool, maintainer of AEM Tools plugin.
Preston-3Author
Level 4
November 8, 2024

This is a custom index meant for Content Fragments, though, and as far as we could tell the underlying search was using the "fragments" index if we didn't create our own index. 

Preston-3Author
Level 4
December 17, 2024

Hi @preston-3,

 

Recently I successfully removed OOTB index customization just by removing it from the project. I removed index definition from /apps/_oak_index/.content.xml and removed filter from META-INF/vault/filter.xml.

Official documentation says:

A customized index may be removed in a later version of the customer application, by removing it from the customer repository. An index which is removed from the repository is not used for queries in AEM although it might still be present in the instances for a while. There is a clean-up mechanism in place that runs periodically which cleans up older versions of indexes from the instances.

 

Best regards,

Kostiantyn Diachenko.


Kostiantyn,

 

This did work for us. It's unclear what AEM does with that index as we can still see it in oak:index, but it stops being used. Did you see it eventually cleaned up? 

Preston

kautuk_sahni
Community Manager
Community Manager
November 26, 2024

@preston-3 Did you find the suggestion helpful? Please let us know if you require more information. Otherwise, please mark the answer as correct for posterity. If you've discovered a solution yourself, we would appreciate it if you could share it with the community. Thank you!

Kautuk Sahni
Preston-3Author
Level 4
December 17, 2024

Yes. This was very helpful.