Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

DAM contents are disappearing after creating a new index

Avatar

Community Advisor

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?

Topics

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

6.5
1 Accepted Solution

Avatar

Correct answer by
Community Advisor

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

Avatar

Correct answer by
Community Advisor

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.

Avatar

Administrator

@Anmol_Bhardwaj Thank you for sharing the solution for the broader community. 



Kautuk Sahni