Expand my Community achievements bar.

SOLVED

Add custom index to cqPageLucene Index

Avatar

Level 3

I know some of the indexes are OOTB from Adobe in cqPageLucene. I need to add additional index such as pageReplicationAction in cqPageLucene so I would like to see if the .content.xml would be correct like below:

 

<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:oak="http://jackrabbit.apache.org/oak/ns/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
jcr:primaryType="oak:QueryIndexDefinition"
async="[async,nrt]"
compatVersion="{Long}2"
evaluatePathRestrictions="{Boolean}true"
forceReindex="{Boolean}false"
tags="[slingSitemaps]"
reindexCount="{Long}1"
seed="{Long}216358653532915329"
supersedes="[/oak:index/cqDefaultFormFor,/oak:index/fpContentType,/oak:index/cqOwnerCanvasPage,/oak:index/cqVariantFamily,/oak:index/damStatus,/oak:index/campaignpath,/oak:index/slingVanityPath,/oak:index/type,/oak:index/contentPath,/oak:index/cq:masterBuildingBlockPath,/oak:index/containeeInstanceId,/oak:index/cqCloudServiceConfigs,/oak:index/slingAlias,/oak:index/cqCugEnabled,/oak:index/active,/oak:index/cq:masterBuildingBlock,/oak:index/cqAcUUID,/oak:index/cqKeywords,/oak:index/cqCloudServiceConfig,/oak:index/cqConf,/oak:index/cq:targetOfferId,/oak:index/postId,/oak:index/verb,/oak:index/extensionType,/oak:index/fpNodeType,/oak:index/guideComponentType,/oak:index/cqMaster,/oak:index/cqIsCommunitySite,/oak:index/deviceIdentificationMode,/oak:index/lockCreated,/oak:index/processingProfile,/oak:index/ec-uuid,/oak:index/slingResources,/oak:index/slingResourceType,/oak:index/subType,/oak:index/slingResourceSuperType,/oak:index/damS7watch,/oak:index/jcrLockOwner,/oak:index/cqTemplate,/oak:index/fragmentPath]"
type="lucene">
<indexRules jcr:primaryType="nt:unstructured">
<cqPage jcr:primaryType="nt:unstructured">
<properties jcr:primaryType="nt:unstructured">
<pageReplicationAction
jcr:primaryType="nt:unstructured"
name="jcr:content/cq:pageReplicationAction"
propertyIndex="{Boolean}true"
type="String"/>
</properties>
</cqPage>
</indexRules>
</jcr:root>

  

Topics

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

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hello @aemUser2345 

 

few points to consider while creating index:

In short, check-in only whats new/should be modified.

 

 


Aanchal Sikka

View solution in original post

6 Replies

Avatar

Community Advisor

Hi @aemUser2345 

 

The provided .content.xml snippet appears to be mostly correct for adding a custom index for the pageReplicationAction property to the cqPageLucene index in Adobe Experience Manager (AEM). However, there are a couple of adjustments needed for it to work properly:

  1. The cqPage node type should be cq:Page. So, change <cqPage jcr:primaryType="nt:unstructured"> to <cq:Page jcr:primaryType="nt:unstructured">.

  2. The name attribute of the pageReplicationAction property should be set to the relative path of the property within the cq:Page nodes. Assuming pageReplicationAction is directly under jcr:content, it should be "jcr:content/pageReplicationAction".
    Here's the corrected snippet:

 

<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:oak="http://jackrabbit.apache.org/oak/ns/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
          jcr:primaryType="oak:QueryIndexDefinition"
          async="[async,nrt]"
          compatVersion="{Long}2"
          evaluatePathRestrictions="{Boolean}true"
          forceReindex="{Boolean}false"
          tags="[slingSitemaps]"
          reindexCount="{Long}1"
          seed="{Long}216358653532915329"
          supersedes="[/oak:index/cqDefaultFormFor,/oak:index/fpContentType,/oak:index/cqOwnerCanvasPage,/oak:index/cqVariantFamily,/oak:index/damStatus,/oak:index/campaignpath,/oak:index/slingVanityPath,/oak:index/type,/oak:index/contentPath,/oak:index/cq:masterBuildingBlockPath,/oak:index/containeeInstanceId,/oak:index/cqCloudServiceConfigs,/oak:index/slingAlias,/oak:index/cqCugEnabled,/oak:index/active,/oak:index/cq:masterBuildingBlock,/oak:index/cqAcUUID,/oak:index/cqKeywords,/oak:index/cqCloudServiceConfig,/oak:index/cqConf,/oak:index/cq:targetOfferId,/oak:index/postId,/oak:index/verb,/oak:index/extensionType,/oak:index/fpNodeType,/oak:index/guideComponentType,/oak:index/cqMaster,/oak:index/cqIsCommunitySite,/oak:index/deviceIdentificationMode,/oak:index/lockCreated,/oak:index/processingProfile,/oak:index/ec-uuid,/oak:index/slingResources,/oak:index/slingResourceType,/oak:index/subType,/oak:index/slingResourceSuperType,/oak:index/damS7watch,/oak:index/jcrLockOwner,/oak:index/cqTemplate,/oak:index/fragmentPath]"
          type="lucene">
    <indexRules jcr:primaryType="nt:unstructured">
        <cq:Page jcr:primaryType="nt:unstructured">
            <properties jcr:primaryType="nt:unstructured">
                <pageReplicationAction
                        jcr:primaryType="nt:unstructured"
                        name="jcr:content/pageReplicationAction"
                        propertyIndex="{Boolean}true"
                        type="String"/>
            </properties>
        </cq:Page>
    </indexRules>
</jcr:root>

 

  • These adjustments ensure that the index is properly configured to index the pageReplicationAction property of cq:Page nodes within the cqPageLucene index in AEM.

 

Thanks

Avatar

Level 3

Thanks. After I add the xml file to the oak-index, it should be reflected on CRXDE right? For some reason, it is not showing up

Avatar

Community Advisor

@aemUser2345 

 

Please verify that the index is included in filter.xml of the module.


Aanchal Sikka

Avatar

Correct answer by
Community Advisor

Hello @aemUser2345 

 

few points to consider while creating index:

In short, check-in only whats new/should be modified.

 

 


Aanchal Sikka

Avatar

Administrator

@aemUser2345 Did you find the suggestions from users helpful? Please let us know if more information is required. Otherwise, please mark the answer as correct for posterity. If you have found out solution yourself, please share it with the community.



Kautuk Sahni