Expand my Community achievements bar.

Introducing Adobe LLM Optimizer: Own your brand’s presence in AI-Powered search and discovery
SOLVED

Changes in custom index for AEMaaCS not working

Avatar

Level 5

Hey guys,

 

I am working on oak indexing and I have the below issue -

 

There is a customization of an OOTB index cqPageLucene. We are adding some additional paths to index by adding properties "includedPaths=/content/commerce/offers" and "querypaths=/content/commerce/offers"

Else, the index is exactly the same as OOTB index.

 

Following Index Names -

Customization of an OOTB index. These are indicated by appending -custom- followed by a numerical identifier to the original index name. For example: /oak:index/cqPageLucene-custom-1

However, the deployment of the above index is leading to AEM Sites Search not working on the authoring site.

Removing the index is fixing the problem.

 

We tried below 2 approaches to fix the problem -

  1. Rename the index to cqPageLucene-custom-2
  2. Rename the index altogether to something custom like cqOffer-custom-1

But ideally even the first index name cqPageLucene-custom-1 is correct and should have worked!

 

BR,

Nagesh

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @NageshRaja ,

 

In this case you enabled indexing of nodes only under /content/commerce/offers. 

 

By default, cqPageLucene is indexing everything (according to the definition) under root except paths in excludedPaths(/var, /etc/replication, /etc/workflow/instances, /jcr:system).

 

Why did you need to customize queryPaths and includedPaths?

 

Try to create custom index like com.cqPageLucene-0-custom-1 and configure it with "includedPaths=/content/commerce/offers" and "querypaths=/content/commerce/offers".

 

Best regards,

Kostiantyn Diachenko.

Kostiantyn Diachenko



Check out AEM VLT Intellij plugin


View solution in original post

6 Replies

Avatar

Community Advisor

Hi @NageshRaja 


Could you verify if the following entries are present in your _
oak_index(.content.xml) within the repository?

 

<?xml version="1.0" encoding="UTF-8"?>
<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" xmlns:rep="internal"
jcr:mixinTypes="[rep:AccessControllable]"
jcr:primaryType="nt:unstructured">
<socialLucene/>
<cmLucene-2/>
<slingeventJob/>
<jcrLanguage/>
<cqTagLucene-3/>
<versionStoreIndex/>
<repMembers/>
<assetPrefixNodename-1/>
<cqReportsLucene/>
<commerceLucene/>
<damAssetStateIndex-4/>
<counter/>
<authorizables/>
<internalVerificationLucene/>
<formsTemplateLucene/>
<externalPrincipalNames/>
<slingQuickSites-1/>
<cqProjectLucene/>
<acPrincipalName/>
<uuid/>
<ntBaseLucene-2/>
<fragments-7/>
<experienceFragmentsIndex-3/>
<repAccessControllableDamLucene-1/>
<ntFileFolderLucene/>
<pathReference/>
<rep:policy/>
<ntFolderDamLucene-6/>
<workflowDataLucene-2/>
<graphqlConfig-2/>
<cqPayloadPath/>
<appsLibsLucene/>
<nodetypeLucene/>
<nodetype/>
<reference/>
<screensSmartSyncJcrPrimaryType/>
<principalName/>
<repTokenIndex/>
<damCollectionLucene-4/>
<externalId/>
<damAssetLucene-8/>
<slingSitemaps-1/>
<authorizableId/>
<cqPageLucene-custom-1
jcr:primaryType="oak:QueryIndexDefinition"
async="[async,nrt]"
compatVersion="{Long}2"
evaluatePathRestrictions="{Boolean}true"
excludedPaths="[/var,/etc/replication,/etc/workflow/instances,/jcr:system]"
includedPaths="[/content/commerce/offers]"
queryPaths="[/content/commerce/offers]"
reindex="{Boolean}false"
reindexCount="{Long}1"
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>
<nt:file jcr:primaryType="nt:unstructured">
<include0
jcr:primaryType="nt:unstructured"
path="jcr:content"/>

</nt:file>
<cq:PageContent jcr:primaryType="nt:unstructured">
<include0
jcr:primaryType="nt:unstructured"
path="*"/>

<include1
jcr:primaryType="nt:unstructured"
path="*/*"/>

<include2
jcr:primaryType="nt:unstructured"
path="*/*/*"/>

<include3
jcr:primaryType="nt:unstructured"
path="*/*/*/*"/>

</cq:PageContent>
</aggregates>
<indexRules jcr:primaryType="nt:unstructured">
<cq:Page
jcr:primaryType="nt:unstructured"
includePropertyTypes="all">

<properties jcr:primaryType="nt:unstructured">
<cqLastModified
jcr:primaryType="nt:unstructured"
name="jcr:content/cq:lastModified"
ordered="{Boolean}true"
propertyIndex="{Boolean}true"
type="Date"/>

<jcrTitle
jcr:primaryType="nt:unstructured"
name="jcr:content/jcr:title"
nodeScopeIndex="{Boolean}true"
propertyIndex="{Boolean}true"
type="String"
useInSpellcheck="{Boolean}true"
useInSuggest="{Boolean}true"/>

<pageTitle
jcr:primaryType="nt:unstructured"
name="jcr:content/pageTitle"
nodeScopeIndex="{Boolean}true"
propertyIndex="{Boolean}true"
type="String"
useInSpellcheck="{Boolean}true"
useInSuggest="{Boolean}true"/>

<navTitle
jcr:primaryType="nt:unstructured"
name="jcr:content/navTitle"
nodeScopeIndex="{Boolean}true"
propertyIndex="{Boolean}true"
type="String"
useInSpellcheck="{Boolean}true"
useInSuggest="{Boolean}true"/>

<nodeName
jcr:primaryType="nt:unstructured"
name=":nodeName"
nodeScopeIndex="{Boolean}true"
propertyIndex="{Boolean}true"
type="String"
useInSpellcheck="{Boolean}true"
useInSuggest="{Boolean}true"/>

<cqLastRolledoutBy
jcr:primaryType="nt:unstructured"
name="jcr:content/cq:lastRolledoutBy"
propertyIndex="{Boolean}true"
type="String"/>

<location
jcr:primaryType="nt:unstructured"
name="jcr:content/location"
notNullCheckEnabled="{Boolean}true"
propertyIndex="{Boolean}true"
type="String"/>

</properties>
</cq:Page>
</indexRules>
</cqPageLucene-custom-1>
<packageLucene/>
<screensContentJcrPrimaryType/>
</jcr:root>


Then you should have the following entry in ui.apps filter.xml as well.

<filter root="/oak:index/cqPageLucene-custom-1" mode="update_properties"/>

 

Thanks,

Asutosh Jena

Avatar

Correct answer by
Community Advisor

Hi @NageshRaja ,

 

In this case you enabled indexing of nodes only under /content/commerce/offers. 

 

By default, cqPageLucene is indexing everything (according to the definition) under root except paths in excludedPaths(/var, /etc/replication, /etc/workflow/instances, /jcr:system).

 

Why did you need to customize queryPaths and includedPaths?

 

Try to create custom index like com.cqPageLucene-0-custom-1 and configure it with "includedPaths=/content/commerce/offers" and "querypaths=/content/commerce/offers".

 

Best regards,

Kostiantyn Diachenko.

Kostiantyn Diachenko



Check out AEM VLT Intellij plugin


Avatar

Level 5

yes @Asutosh_Jena_ the cqPageLucene-custom-1 is present as is.

Avatar

Community Advisor

Hi @NageshRaja


Can you share your index definition once here?

 

Thanks,

Rohan Garg

Avatar

Level 5

Hey @Rohan_Garg, please check your inbox for the same! The approach #2 worked for us, I have also sent you the logs for the same.

Avatar

Community Advisor

Hi @NageshRaja, I tried to use the OTB lucene index with some custom paths and had no problem! However, creating a custom index with your custom paths would be the best way to go as suggested by @konstantyn_diachenko
Is there any particular reason why you are looking to override only OTB index definition?

 

Regards,

Rohan Garg