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
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

Issue with Indexes with graphQL APIs/queries

Avatar

Level 2

Hi All,

 

We have integrated GraphQL with AEM 6.5.13. The APIs are working fine but failing issue in error.log as getting WARN as:

*WARN* [204.28.140.7 [1669003115125] GET <query endpoint> HTTP/1.1] org.apache.jackrabbit.oak.plugins.index.search.spi.query.FulltextIndex$FulltextPathCursor Index-Traversed 20000 nodes

 

We have installed the "cfm-graphql-index-def-1.0.5.zip" package and have validated that the following indexes are present:

/oak:index/assetPrefixNodename
/oak:index/fragments

 

We have also tried to rebuild the indexes but the logs still report the warnings.

 

We tried  https://IP/libs/granite/operations/content/diagnosistools/queryPerformance.html to explain the query and noticed that the GraphQL queries are using "damAssetLucene(/oak:index/damAssetLucene)" index and not "/oak:index/fragments".

 

We tried the https://oakutils.appspot.com/generate/index to check the new index definition but the suggestions were in sync with "/oak:index/fragments" index.

 

Please advise what we are missing or do we need to create new indexes.

 

Logs for "Explain Query":

Applicable IndexingRule found IndexRule: nt:base Applicable IndexingRule found IndexRule: nt:base Applicable IndexingRule found IndexRule: nt:base Applicable IndexingRule found IndexRule: nt:base Applicable IndexingRule found IndexRule: nt:base Applicable IndexingRule found IndexRule: dam:Asset Applicable IndexingRule found IndexRule: dam:Asset cost for [/oak:index/assetPrefixNodename] of type (lucene-property) with plan [lucene:assetPrefixNodename(/oak:index/assetPrefixNodename) +:ancestors:/content/dam +jcr:content/contentFragment:true] is 1010100000.00 cost for [/oak:index/damAssetLucene] of type (lucene-property) with plan [lucene:damAssetLucene(/oak:index/damAssetLucene) :ancestors:/content/dam] is 21672.00 cost for lucene-property is Infinity cost for aggregate lucene is Infinity looking for plans for paths : [] cost for aggregate solr is Infinity cost for traverse is 403556.0

 

 

Thanks,

Nitish

1 Accepted Solution

Avatar

Correct answer by
Employee

As per the screen shot attached, it appears oak:index/fragments is not even getting evaluated for the query. Please follow below link to troubleshoot:

https://experienceleague.adobe.com/docs/experience-manager-65/deploying/deploying/troubleshooting-oa...

 

You need the query to detect fragment index.

@nitish-jain 

View solution in original post

10 Replies

Avatar

Level 8

Hi @nitish-jain ,

   Just for testing purpose., could you please move the "fragments" index definition inside the content fragments folder and run the query again to see if it picks the fragments index instead of damLuceneIndex ? 

Avatar

Level 2

yes, the reindexing happens. but when the query is executed still seeing same "WARN" in logs

Avatar

Employee

The WARN message, does not indicate it is coming out of Content Fragment query.

 

Can you please check other queries, who can possibly be the culprit for this Warn Msg.

@nitish-jain 

 

Avatar

Level 2

@krati_garg, actually yes. I have only pasted the partial query from the logs. The complete logger statement has the graphQL query/content fragment information

 

*WARN*   GET /graphql/execute.json/<query_path>HTTP/1.1] org.apache.jackrabbit.oak.plugins.index.search.spi.query.FulltextIndex$FulltextPathCursor Index-Traversed 20000 nodes with filter Filter(query=SELECT asset.* FROM [dam:Asset] AS asset WHERE ISDESCENDANTNODE(asset, '/content/dam') AND asset.[jcr:content/contentFragment] = CAST('true' AS BOOLEAN) AND asset.[jcr:content/data/cq:model] = '/conf/<content_fragment_model_path>' ORDER BY asset.[jcr:path], path=/content/dam//*, property=[jcr:content/contentFragment=[true], jcr:content/data/cq:model=[/conf/<content_fragment_model_path>]])

Avatar

Employee

On my local set up, I tried executing similar query and with above mentioned - cfm-graphql-index-def-1.0.5.zip

 

For me -  fragments(/oak:index/fragments) is being picked as Index and the cost for this index is coming out to be 12. Please see the screen shot. 

krati_garg_0-1669224875727.png

 

Can you please check, which index is being picked for you?

Avatar

Level 2

on the environment,  "damAssetLucene(/oak:index/damAssetLucene)" index is being picked.  I tried re-indexing on the server without any luck. Let me check on the local server. Thanks.

Avatar

Level 2

It is picking  [lucene:assetPrefixNodename(/oak:index/assetPrefixNodename) and [lucene:damAssetLucene(/oak:index/damAssetLucene) indexes to compare.

 

I tried re-indexing the "/oak:index/fragments" but it is still not getting picked.

nitishjain_0-1669230474152.png

nitishjain_2-1669230519183.png

 

 

nitishjain_1-1669230503051.png

 

Avatar

Correct answer by
Employee

As per the screen shot attached, it appears oak:index/fragments is not even getting evaluated for the query. Please follow below link to troubleshoot:

https://experienceleague.adobe.com/docs/experience-manager-65/deploying/deploying/troubleshooting-oa...

 

You need the query to detect fragment index.

@nitish-jain