내 커뮤니티 업적 표시줄을 확대합니다.

Submissions are now open for the 2026 Adobe Experience Maker Awards.
해결됨

Index jcr:content/cq:lastReplicationAction - Not a valid JCR Name

Avatar

Level 3

I am trying to create custom index on jcr:content/cq:lastReplicationAction on AEM but for some reason it complained about "Not A Valid JCR Name"

 

wenwang1_0-1706059080373.png

 

 

Am I missing something here?

주제

토픽은 커뮤니티 콘텐츠를 분류하여 관련성 있는 콘텐츠를 찾는 데 도움이 됩니다.

1 채택된 해결책 개

Avatar

정확한 답변 작성자:
Community Advisor

@aemUser2345 
For Property Index in OakIndexDefinition,
You need not specify path of the property, just go with all properties in propertyNames field (i.e. cq:lastReplicationAction)
And then you can specify node type for which this index is applicable in declaringNodeTypes field (i.e. cq:PageContent)
These should work.

For more info on above properties:
Checkout documentation : https://jackrabbit.apache.org/oak/docs/query/indexing.html

And these relevant references :

  1.  https://myaemlearnings.blogspot.com/2020/05/property-index-in-aem-index-properties.html
  2. https://experienceleague.adobe.com/docs/experience-manager-65/content/implementing/deploying/deployi...
  3. https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/property-index-in-aem-inde...

 

원본 게시물의 솔루션 보기

4 답변 개

Avatar

Community Advisor

When creating a property index in AEM, you typically only need to specify the property name itself, without the full node path. This is because property indexes focus on indexing individual property values within nodes, not the entire node structure.

Avatar

Community Advisor

Hi @aemUser2345 
It seems like you are encountering an issue with creating a custom index on jcr:content/cq:lastReplicationAction.The error message "Not a Valid JCR Name" suggests that there might be an issue with the syntax or format of the index definition
Make sure that the name attribute in the <cq:lastReplicationAction> property definition adheres to the rules for valid JCR names.

<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:sling="http://www.apache.org/jackrabbit/sling/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
    jcr:primaryType="sling:OsgiConfig"
    reindex="true">

    <!-- Define the custom index -->
    <index
        jcr:primaryType="oak:QueryIndexDefinition"
        async="async"
        compatVersion="{Long}2"
        evaluatePathRestrictions="{Boolean}false"
        type="lucene">
        
        <!-- Specify the index rules -->
        <indexRules jcr:primaryType="nt:unstructured">
            <nt:base
                jcr:primaryType="nt:unstructured">
                <properties
                    jcr:primaryType="nt:unstructured">
                    <cq:lastReplicationAction
                        jcr:primaryType="nt:unstructured"
                        name="cq:lastReplicationAction"
                        type="String"/>
                </properties>
            </nt:base>
        </indexRules>
    </index>
</jcr:root>

 



Avatar

정확한 답변 작성자:
Community Advisor

@aemUser2345 
For Property Index in OakIndexDefinition,
You need not specify path of the property, just go with all properties in propertyNames field (i.e. cq:lastReplicationAction)
And then you can specify node type for which this index is applicable in declaringNodeTypes field (i.e. cq:PageContent)
These should work.

For more info on above properties:
Checkout documentation : https://jackrabbit.apache.org/oak/docs/query/indexing.html

And these relevant references :

  1.  https://myaemlearnings.blogspot.com/2020/05/property-index-in-aem-index-properties.html
  2. https://experienceleague.adobe.com/docs/experience-manager-65/content/implementing/deploying/deployi...
  3. https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/property-index-in-aem-inde...

 

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