Custom Index Cloud | Community
Skip to main content
Sean-McK
Level 4
October 24, 2022
Solved

Custom Index Cloud

  • October 24, 2022
  • 1 reply
  • 2108 views

I am trying to add a couple of fields to experienceFragmentsIndex-3 .. I did all of the instructions and didn't even change the code I got from dev server on cloud:

    <experienceFragmentsIndex-3-custom-1
        jcr:primaryType="oak:QueryIndexDefinition"
        async="[async,nrt]"
        compatVersion="{Long}2"
        evaluatePathRestrictions="{Boolean}true"
        includedPaths="[/content/experience-fragments]"
        queryPaths="[/content/experience-fragments]"
        reindex="{Boolean}false"
        reindexCount="{Long}1"
        seed="{Long}7872558779417643971"
        type="lucene">
        <aggregates jcr:primaryType="nt:unstructured">
            <cq:Page jcr:primaryType="nt:unstructured">
                <include0
                    jcr:primaryType="nt:unstructured"
                    path="jcr:content"
                    relativeNode="{Boolean}true"/>
            </cq:Page>
            <cq:PageContent jcr:primaryType="nt:unstructured">
                <include0
                    jcr:primaryType="nt:unstructured"
                    path="*"/>
                <include1
                    jcr:primaryType="nt:unstructured"
                    path="*/*"/>
            </cq:PageContent>
        </aggregates>
        <indexRules jcr:primaryType="nt:unstructured">
            <cq:Page
                jcr:primaryType="nt:unstructured"
                indexNodeName="{Boolean}true">
                <properties jcr:primaryType="nt:unstructured">
                    <resourceType
                        jcr:primaryType="nt:unstructured"
                        name="jcr:content/sling:resourceType"
                        propertyIndex="{Boolean}true"
                        type="String"/>
                    <cqXfVariantType
                        jcr:primaryType="nt:unstructured"
                        name="jcr:content/cq:xfVariantType"
                        propertyIndex="{Boolean}true"
                        type="String"/>
                    <cqTags
                        jcr:primaryType="nt:unstructured"
                        name="jcr:content/cq:tags"
                        propertyIndex="{Boolean}true"
                        type="String"/>
                    <cqLastModified
                        jcr:primaryType="nt:unstructured"
                        name="jcr:content/cq:lastModified"
                        ordered="{Boolean}true"
                        propertyIndex="{Boolean}true"
                        type="Date"/>
                    <jcrCreated
                        jcr:primaryType="nt:unstructured"
                        name="jcr:created"
                        ordered="{Boolean}true"
                        propertyIndex="{Boolean}true"
                        type="Date"/>
                </properties>
            </cq:Page>
        </indexRules>
    </experienceFragmentsIndex-3-custom-1>
 
I get a build issue "ValidationViolation: "jackrabbit-docviewparser: Invalid XML found: The prefix "cq" for element "cq:Page" is not bound.", filePath=jcr_root\_oak_index\.content.xml, nodePath=/oak:index"
 
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 Lokesh_Vajrala
    <experienceFragmentsIndex-3-custom-1
        jcr:primaryType="oak:QueryIndexDefinition"
        async="[async,nrt]"
        compatVersion="{Long}2"
        evaluatePathRestrictions="{Boolean}true"
        includedPaths="[/content/experience-fragments]"
        queryPaths="[/content/experience-fragments]"
        reindex="{Boolean}false"
        reindexCount="{Long}1"
        seed="{Long}7872558779417643971"
        type="lucene">
        <aggregates jcr:primaryType="nt:unstructured">
            <cq:Page jcr:primaryType="nt:unstructured">
                <include0
                    jcr:primaryType="nt:unstructured"
                    path="jcr:content"
                    relativeNode="{Boolean}true"/>
            </cq:Page>
            <cq:PageContent jcr:primaryType="nt:unstructured">
                <include0
                    jcr:primaryType="nt:unstructured"
                    path="*"/>
                <include1
                    jcr:primaryType="nt:unstructured"
                    path="*/*"/>
            </cq:PageContent>
        </aggregates>
        <indexRules jcr:primaryType="nt:unstructured">
            <cq:Page
                jcr:primaryType="nt:unstructured"
                indexNodeName="{Boolean}true">
                <properties jcr:primaryType="nt:unstructured">
                    <resourceType
                        jcr:primaryType="nt:unstructured"
                        name="jcr:content/sling:resourceType"
                        propertyIndex="{Boolean}true"
                        type="String"/>
                    <cqXfVariantType
                        jcr:primaryType="nt:unstructured"
                        name="jcr:content/cq:xfVariantType"
                        propertyIndex="{Boolean}true"
                        type="String"/>
                    <cqTags
                        jcr:primaryType="nt:unstructured"
                        name="jcr:content/cq:tags"
                        propertyIndex="{Boolean}true"
                        type="String"/>
                    <cqLastModified
                        jcr:primaryType="nt:unstructured"
                        name="jcr:content/cq:lastModified"
                        ordered="{Boolean}true"
                        propertyIndex="{Boolean}true"
                        type="Date"/>
                    <jcrCreated
                        jcr:primaryType="nt:unstructured"
                        name="jcr:created"
                        ordered="{Boolean}true"
                        propertyIndex="{Boolean}true"
                        type="Date"/>
                </properties>
            </cq:Page>
        </indexRules>
    </experienceFragmentsIndex-3-custom-1>

 

I would use the below for .content.xml and experienceFragmentsIndex-3-custom-1 would be a simple directory

 

<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:oak="http://jackrabbit.apache.org/oak/ns/1.0"
          xmlns:sling="http://sling.apache.org/jcr/sling/1.0"
          xmlns:cq="http://www.day.com/jcr/cq/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"
    includedPaths="[/content/experience-fragments]"
    queryPaths="[/content/experience-fragments]"
    reindex="{Boolean}false"
    reindexCount="{Long}1"
    seed="{Long}7872558779417643971"
    type="lucene">
    <aggregates jcr:primaryType="nt:unstructured">
        <cq:Page jcr:primaryType="nt:unstructured">
            <include0
                jcr:primaryType="nt:unstructured"
                path="jcr:content"
                relativeNode="{Boolean}true"/>
        </cq:Page>
        <cq:PageContent jcr:primaryType="nt:unstructured">
            <include0
                jcr:primaryType="nt:unstructured"
                path="*"/>
            <include1
                jcr:primaryType="nt:unstructured"
                path="*/*"/>
        </cq:PageContent>
    </aggregates>
    <indexRules jcr:primaryType="nt:unstructured">
        <cq:Page
            jcr:primaryType="nt:unstructured"
            indexNodeName="{Boolean}true">
            <properties jcr:primaryType="nt:unstructured">
                <resourceType
                    jcr:primaryType="nt:unstructured"
                    name="jcr:content/sling:resourceType"
                    propertyIndex="{Boolean}true"
                    type="String"/>
                <cqXfVariantType
                    jcr:primaryType="nt:unstructured"
                    name="jcr:content/cq:xfVariantType"
                    propertyIndex="{Boolean}true"
                    type="String"/>
                <cqTags
                    jcr:primaryType="nt:unstructured"
                    name="jcr:content/cq:tags"
                    propertyIndex="{Boolean}true"
                    type="String"/>
                <cqLastModified
                    jcr:primaryType="nt:unstructured"
                    name="jcr:content/cq:lastModified"
                    ordered="{Boolean}true"
                    propertyIndex="{Boolean}true"
                    type="Date"/>
                <jcrCreated
                    jcr:primaryType="nt:unstructured"
                    name="jcr:created"
                    ordered="{Boolean}true"
                    propertyIndex="{Boolean}true"
                    type="Date"/>
            </properties>
        </cq:Page>
    </indexRules>
</jcr:root>

 

 

1 reply

Lokesh_Vajrala
Community Advisor
Community Advisor
October 25, 2022

Hi @sean-mck

 

I'm guessing you're missing the cq namespace tag in your file.

 

Do you see the tag namespace for cq at the jcr:root node in experienceFragmentsIndex-3-custom-1/.content.xml file? If you don't see it at the jcr:root node, you can add the below to fix the build issue.

xmlns:cq="http://www.day.com/jcr/cq/1.0"

jcr:root node in the .content.xml file would look something like this 

<jcr:root xmlns:oak="http://jackrabbit.apache.org/oak/ns/1.0" xmlns:cq="http://www.day.com/jcr/cq/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" .....>

Thanks,

Lokesh

Sean-McK
Sean-McKAuthor
Level 4
October 25, 2022

Hey Lokesh,

 

That doesn't work....I get even more errors like:

"jackrabbit-filter: Node '/oak:index/experienceFragmentsIndex-3-custom-1/aggregates/cq:Page' is not contained in any of the filter rules"

and

"jackrabbit-filter: Node '/oak:index/experienceFragmentsIndex-3-custom-1/aggregates/cq:Page/include0' is not contained in any of the filter rules"

Lokesh_Vajrala
Community Advisor
Community Advisor
October 25, 2022

@sean-mck , Can you paste the experienceFragmentsIndex-3-custom-1/.content.xml content here to look at it?