java.lang.UnsupportedOperationException: The query read or traversed more than 100000 nodes. | Community
Skip to main content
niks1020
Level 2
Nov 7, 2019 5:39 PM UTC
Solved

java.lang.UnsupportedOperationException: The query read or traversed more than 100000 nodes.

Hi ,

I am facing an issue in running the query through my deployed code in AEM.

The map is created as below:

Map<String, String> map = new HashMap<>();

map.put('path', 'path-here');

map.put('type','oak:Unstructured');

map.put("1_property", 'content-type');

map.put("1_property.value", 'value');

map.put("2_property", 'second-property');

map.put("2_property.value", 'true');

map.put("property.and", true);

map.put("orderby",'property to be ordered by');

map.put("p.limit", "-1");

The query.getResult() returns UnsupportedOperationException

When I run the same query in CRX/DE with SQL format I do not face this kind of exception.

select * from oak:Unstructured where jcr:path like 'path-here%'

and contains([content-type], 'value')

and [second-property]='true'

I noticed one thing: If I execute the above SQL query in CRX/DE lite with just changing "contains" to "=" sign as below, I get the below error in CRX/DE lite as well.

"The query read or traversed more than 10000 nodes. To avoid affecting other tasks, processing was stopped."

select * from oak:Unstructured where jcr:path like 'path-here%'

and [content-type]= 'value'

and [second-property]='true'

Can somebody help me?

Thanks,

Nikhil

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
user05162Accepted solution
Employee
Nov 7, 2019 6:09 PM UTC

Use AEM Plugin to find the query that gets triggered and use the oakutils tool to create an index.

The 100000 limit is set at [3] from the JMX console to prevent the AEM instance running out of memory when a traversal query is triggered.

[1] https://chrome.google.com/webstore/detail/aem-chrome-plug-in/ejdcnikffjleeffpigekhccpepplaode

[2] Oak Utilities : Index Definition Generator

[3] <host>:<port>/system/console/jmx/org.apache.jackrabbit.oak%3Aname%3Dsettings%2Ctype%3DQueryEngineSettings

6 replies

Ravi_Pampana
New Participant
Nov 8, 2019 5:11 PM UTC

Hi,

You can check below link which has details for the same issue

Having problem with Query builder when we have more records

Translate
sunjot16
Employee
Nov 8, 2019 4:47 PM UTC

Try generating an index on the query using the following tool:

Oak Utilities : Index Definition Generator

and then create indexes as per the following docs:

Oak Queries and Indexing

Oak Queries and Indexing

Translate
Employee
Nov 8, 2019 1:16 PM UTC

- Go to <host>:<port>/crx/de

- Create the index under "oak:index" directory

- Use any OOTB indexes for reference.

Translate
niks1020
niks1020Author
Level 2
Nov 7, 2019 6:47 PM UTC

Where to put the generated oakIndex from [2]?

Translate
user05162Accepted solution
Employee
Nov 7, 2019 6:09 PM UTC

Use AEM Plugin to find the query that gets triggered and use the oakutils tool to create an index.

The 100000 limit is set at [3] from the JMX console to prevent the AEM instance running out of memory when a traversal query is triggered.

[1] https://chrome.google.com/webstore/detail/aem-chrome-plug-in/ejdcnikffjleeffpigekhccpepplaode

[2] Oak Utilities : Index Definition Generator

[3] <host>:<port>/system/console/jmx/org.apache.jackrabbit.oak%3Aname%3Dsettings%2Ctype%3DQueryEngineSettings

Translate
Ankur_Khare
New Participant
Nov 7, 2019 5:48 PM UTC

You need create custom index so that it doesnt search over entire repository.

Refer below-

http://www.aemcq5tutorials.com/tutorials/aem-oak-indexing-comprehensive-guide/

Translate