Expand my Community achievements bar.

Custom Lucene Index is not getting picked up in aem as cloud

Avatar

Level 2

I am trying to add Custom Lucene index for search is search-custom-1 and this is not getting picked up when i tried to hit the query in query performance, its working in QA env and not in Dev and local, there could be a chance of not getting picked up in stage and prod , please let me know how to make my custom search index picked up when indexing happening.

3 Replies

Avatar

Community Advisor

Hi @Som_ChaithanyaGo - See below

  • Reindexing: Set the reindex property to true on the index node if it’s not active. <reindex>true</reindex> 
  • Error Logs: Inspect the error.log for indexing-related messages to identify issues.

Avatar

Level 2

this is the oak:index i am using it has reindex async and all 

<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:oak="http://jackrabbit.apache.org/oak/ns/1.0" xmlns:rep="internal" xmlns:cq="http://www.day.com/jcr/cq/1.0"
jcr:mixinTypes="[rep:AccessControllable]"
jcr:primaryType="nt:unstructured">
<search-custom-1
jcr:primaryType="oak:QueryIndexDefinition"
async="[fulltext-async,nrt]"
compatVersion="{Long}2"
includedPaths="[/content/my-project]"
queryPaths="[/content/my-project]"
reindex="{Boolean}true"
type="lucene">
<indexRules jcr:primaryType="nt:unstructured">
<cq:Page
jcr:primaryType="nt:unstructured"
includePropertyTypes="[String,Binary]">
<properties jcr:primaryType="nt:unstructured">
<text
jcr:primaryType="nt:unstructured"
name="text"
propertyIndex="{Boolean}true"/>
<hoverCardtext
jcr:primaryType="nt:unstructured"
name="hoverCardtext"
propertyIndex="{Boolean}true"/>
</properties>
</cq:Page>
<nt:base
jcr:primaryType="nt:unstructured"
includePropertyTypes="[String,Binary]">
<properties jcr:primaryType="nt:unstructured">
<cqTemplate
jcr:primaryType="nt:unstructured"
index="{Boolean}false"
name="cq:template"/>
<globalcss
jcr:primaryType="nt:unstructured"
index="{Boolean}false"
name="globalcss"/>
<jumpPageTarget
jcr:primaryType="nt:unstructured"
index="{Boolean}false"
name="jumpPageTarget"/>
<loaderTheme
jcr:primaryType="nt:unstructured"
index="{Boolean}false"
name="loaderTheme"/>
</properties>
</nt:base>
</indexRules>
</search-custom-1>
</jcr:root>

Avatar

Community Advisor
  • Avoid overlapping index definition - Do not have overlapping index definition indexing same nodetype but having different includedPaths and excludedPaths. Index selection logic does not make use of the includedPaths and excludedPaths for index selection. Index selection is done only on cost basis and queryPaths. Having multiple definition for same type would cause ambiguity in index selection and may lead to unexpected results. Instead, have a single index definition for same type.
  • Non root indexes - If your query always perform search under certain paths then create index definition under those paths only. This might be helpful in multi tenant deployment where each tenant data is stored under specific repository path and all queries are made under those path.

    In fact, it's recommended to use single index if all the properties being indexed are related. This would enable Lucene index to evaluate as much property restriction as possible natively (which is faster) and also save on storage cost incurred in storing the node path.

     

Aanchal Sikka