Expand my Community achievements bar.

Enhance your AEM Assets & Boost Your Development: [AEM Gems | June 19, 2024] Improving the Developer Experience with New APIs and Events
SOLVED

Index not getting picked

Avatar

Level 2

Hi all,

 

We are getting some "WARN" in the logs withe the suggestions to create custom index for graphQL query persistent queries. One such query: select * from [nt:unstructured] where isdescendantnode('/conf') and [jcr:path] like '/conf/%/settings/graphql/persistentQueries/%' and [sling:resourceType]='graphql/persistent/query' and (contains(*, 'adventureByPath') or contains(*, 'adventureList')) order by [jcr:path] option(index tag graphqlConfig)

 

I tried "https://oakutils.appspot.com/generate/index" to get the index definition and created the query as per suggestion but it is not getting picked.

 

<myIndex compatVersion="{Long}2" async="async" jcr:primaryType="oak:QueryIndexDefinition" evaluatePathRestrictions="{Boolean}true" type="lucene">
<indexRules jcr:primaryType="nt:unstructured">
<nt:unstructured jcr:primaryType="nt:unstructured">
<properties jcr:primaryType="nt:unstructured">
<path name="jcr:path" ordered="{Boolean}true" jcr:primaryType="nt:unstructured"/>
<resourceType name="sling:resourceType" propertyIndex="{Boolean}true" jcr:primaryType="nt:unstructured"/>
</properties>
</nt:unstructured>
</indexRules>
</myIndex>

 

After going through the "https://jackrabbit.apache.org/oak/docs/query/query-engine.html#index-selection-policy" link, I tried giving "selectionPolicy" and "tag" but still it is not getting picked.

 

<graphqlConfig
jcr:primaryType="oak:QueryIndexDefinition"
async="[async,nrt]"
compatVersion="{Long}2"
evaluatePathRestrictions="{Boolean}true"
includedPaths="[/conf]"
name="graphqlConfig"
queryPaths="[/conf]"
reindex="{Boolean}false"
seed="{Long}-4703725553994086635"
selectionPolicy="tag"
tags="[graphqlConfig]"
type="lucene">
<indexRules jcr:primaryType="nt:unstructured">
<nt:unstructured jcr:primaryType="nt:unstructured">
<properties jcr:primaryType="nt:unstructured">
<jcr:path
jcr:primaryType="nt:unstructured"
name="jcr:path"
ordered="{Boolean}true"/>
<sling:resourceType
jcr:primaryType="nt:unstructured"
name="sling:resourceType"
propertyIndex="{Boolean}true"/>
</properties>
</nt:unstructured>
</indexRules>
</graphqlConfig>

 

Please advise what am I missing here.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

@nitish-jain Hi Nitish, looks like it is a full text search? So you may need to configure a Apache Lucene index accordingly.. Try out..

https://experienceleague.adobe.com/docs/experience-manager-64/deploying/deploying/queries-and-indexi...

 

But somewhere I feel, that should be provided by Adobe package by default and we don't need to create indexes. But cross validate once

View solution in original post

1 Reply

Avatar

Correct answer by
Community Advisor

@nitish-jain Hi Nitish, looks like it is a full text search? So you may need to configure a Apache Lucene index accordingly.. Try out..

https://experienceleague.adobe.com/docs/experience-manager-64/deploying/deploying/queries-and-indexi...

 

But somewhere I feel, that should be provided by Adobe package by default and we don't need to create indexes. But cross validate once