Expand my Community achievements bar.

Submissions are now open for the 2026 Adobe Experience Maker Awards.
SOLVED

Indexing resetting or failing

Avatar

Level 3

Hi Team,

About 3 years ago, I created some nodes under /oak:index/cqPageLucene/indexRules/cq:Page/properties (such as locationtags, etc.). At that time, they worked fine on some sample/test pages, and I never faced issues like queries traversing more than 100,000 nodes.

Since then, those properties were not used in real scenarios.

Now, when I try to use those already indexed properties with more pages, I’m getting the error: “query traversed more than 100,000 nodes, hence query execution stopped.”

To fix it, I tried reindexing by setting the reindex property to true, and it worked temporarily. However, after deployment, the same error reappears: “query traversed more than 100,000 nodes, hence query execution stopped.”
Also, my code does not currently reference or include those indexes.

 

veerareddyc1015_0-1756737009753.pngveerareddyc1015_1-1756737031730.png


need some help on what might be causing this error

Thanks & Regards
Veera

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @veerareddyc1015 ,

 

On one of my on-prem projects the following note from the official doc helped:

Queries that traverse many nodes, or that read many nodes in memory, can be cancelled. The limits can be set at runtime (also while a slow query is running) using JMX, domain “org.apache.jackrabbit.oak”, type “QueryEngineSettings”, attribute names “LimitInMemory” and “LimitReads”. These setting are not persisted, so in the next restart, the default values (unlimited) are used. As a workaround, these limits can be changed using the system properties “oak.queryLimitInMemory” and “oak.queryLimitReads”. Queries that exceed one of the limits are cancelled with an UnsupportedOperationException saying that “The query read more than x nodes… To avoid running out of memory, processing was stopped.”


 

konstantyn_diachenko_1-1757375550254.png

You can override this OSGi configuration for even AEMaaCS project.

 

As a short term solution, you can increase oak.queryLimitReads value. For a long-term solution: revise index, create separate one for certain structure and use it for a queries explicitly.  

 

Kostiantyn Diachenko


Check out AEM VLT Intellij plugin


View solution in original post

3 Replies

Avatar

Level 6

Hi @veerareddyc1015 ,

 

Were you able to run your query in query explanation tool? When you run the query in query explanation tool then you should able to see which index is picked up for your query.

 

First see if it is picking up any index , if it is not picking up any index then issue with your query or yiur Query us not suitable for the index. If it is picking up index then we can debug further.

 

Thanks,

Ramesh.

Avatar

Correct answer by
Community Advisor

Hi @veerareddyc1015 ,

 

On one of my on-prem projects the following note from the official doc helped:

Queries that traverse many nodes, or that read many nodes in memory, can be cancelled. The limits can be set at runtime (also while a slow query is running) using JMX, domain “org.apache.jackrabbit.oak”, type “QueryEngineSettings”, attribute names “LimitInMemory” and “LimitReads”. These setting are not persisted, so in the next restart, the default values (unlimited) are used. As a workaround, these limits can be changed using the system properties “oak.queryLimitInMemory” and “oak.queryLimitReads”. Queries that exceed one of the limits are cancelled with an UnsupportedOperationException saying that “The query read more than x nodes… To avoid running out of memory, processing was stopped.”


 

konstantyn_diachenko_1-1757375550254.png

You can override this OSGi configuration for even AEMaaCS project.

 

As a short term solution, you can increase oak.queryLimitReads value. For a long-term solution: revise index, create separate one for certain structure and use it for a queries explicitly.  

 

Kostiantyn Diachenko


Check out AEM VLT Intellij plugin


Avatar

Administrator

@veerareddyc1015 Just checking in! Were you able to get this resolved? If you found your own solution, sharing the details would be a big help to others who might face the same issue later on. And if one of the replies here helped, whether it fully solved the problem or simply pointed you in the right direction, marking it as accepted makes it much easier for future readers to find. Thanks again for helping close the loop and contributing to the community!



Kautuk Sahni