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("orderby",'property to be ordered by');
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')
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."
and [content-type]= 'value'
Can somebody help me?
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  from the JMX console to prevent the AEM instance running out of memory when a traversal query is triggered.
 Oak Utilities : Index Definition Generator
- Go to <host>:<port>/crx/de
- Create the index under "oak:index" directory
- Use any OOTB indexes for reference.
You can check below link which has details for the same issue
Having problem with Query builder when we have more records
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
Where to put the generated oakIndex from ?
You need create custom index so that it doesnt search over entire repository.