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
BedrockMission!

Learn more

View all

Sign in to view all badges

SOLVED

DAM contents are disappearing after creating a new index

AnmolBhardwaj1808
Level 2
Level 2

Hi,

 

I have created a new index for full-text search with wildcards :

 

 

<search
        jcr:primaryType="oak:QueryIndexDefinition"
        async="[async]"
        compatVersion="{Long}2"
        evaluatePathRestrictions="{Boolean}true"
        excludedPaths="[/var,/etc/replication,/etc/workflow/instances,/jcr:system,/content/dam]"
        fulltextEnabled="{Boolean}true"
        includedPaths="[/content/]"
        reindex="{Boolean}false"
        reindexCount="{Long}36"
        seed="{Long}9003429838731429477"
        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>
        </aggregates>
        <indexRules jcr:primaryType="nt:unstructured">
            <nt:base
                jcr:primaryType="nt:unstructured"
                includePropertyTypes="[String,Binary]">
                <properties jcr:primaryType="nt:unstructured">
                    <template
                        jcr:primaryType="nt:unstructured"
                        name="jcr:content/cq:template"
                        propertyIndex="{Boolean}true"/>
                    <lastModified
                        jcr:primaryType="nt:unstructured"
                        name="jcr:content/cq:lastModified"
                        ordered="{Boolean}true"/>
                    <isFeatured
                        jcr:primaryType="nt:unstructured"
                        name="jcr:content/isFeatured"
                        ordered="{Boolean}true"/>
                    <prop
                        jcr:primaryType="nt:unstructured"
                        analyzed="{Boolean}true"
                        isRegexp="{Boolean}true"
                        name="^[^\\/]*$"
                        nodeScopeIndex="{Boolean}true"
                        useInExcerpt="{Boolean}true"/>
                    <isHidden
                        jcr:primaryType="nt:unstructured"
                        name="jcr:content/isHidden"
                        propertyIndex="{Boolean}true"/>
                </properties>
            </nt:base>
        </indexRules>
    </search>

 

 

The index is working for what it is meant for as in, it is showing results faster now.

But, after creating the index, all the DAM content is disappearing.

I have also included /content/dam in the excludedPaths[] but no change.

Can anyone please tell me what I'm doing wrong.

I have tried to change the indexrules nodeName from nt:base to cq:Page/cq:PageContent, but when I do that it is no longer picking up the index during the query.

 

I have to search within cq:Page in the jcr:content for a string like *retai* which is using wildcards.

Any ideas?

AEM 6.5 oak:index
1 Accepted Solution
AnmolBhardwaj1808
Correct answer by
Level 2
Level 2

I found the issue, the index was overriding OOTB lucene index because of the prop in the index rules. And because we don't have dam assets indexed in this, they were showing as blank.

As we are using wildcards in fulltext we need that property. So, to overcome this, I have added a property:

includedPaths[] = /content/<project-name>.

This way it only takes the queries inside that.

View solution in original post

2 Replies
AnmolBhardwaj1808
Correct answer by
Level 2
Level 2

I found the issue, the index was overriding OOTB lucene index because of the prop in the index rules. And because we don't have dam assets indexed in this, they were showing as blank.

As we are using wildcards in fulltext we need that property. So, to overcome this, I have added a property:

includedPaths[] = /content/<project-name>.

This way it only takes the queries inside that.

View solution in original post