Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

My query has a giving exception error, an error occurred while explaining the query even getting null data.

Avatar

Level 4

I have a one servlet call and using that I am executing one query but this query is giving me an exception and I found to in that query I am fetching the devices which having derivedInventoryStatus = 'BackOrder'.

 

And derivedInventoryStatus property is set/coming from aem catalog drop downfield.

 

Query: SELECT * FROM [nt:unstructured] AS s WHERE (ISDESCENDANTNODE(s, [/etc/commerce/products/myProject/en/devices])) and s.derivedInventoryStatus = 'BackOrder'

Errors:

An error occurred while explaining the query.
The query read or traversed more than 100000 nodes. To avoid affecting other tasks, processing was stopped.
org.apache.jackrabbit.oak.query.FilterIterators.checkReadLimit(FilterIterators.java:70)
org.apache.jackrabbit.oak.plugins.index.Cursors$TraversingCursor.fetchNext(Cursors.java:341)

 

public static final String API_DEVICE_SKU_DEVICED_INVENTORY_STATUS = "derivedInventoryStatus";

 

@JsonSerialize(using = CustomStringClassSerializer.class)
public String getDerivedInventoryStatus() {
return AntiSlingModelHelper.getString(resource, MYConstants.API_DEVICE_SKU_DEVICED_INVENTORY_STATUS,
MyConstants.CLASS_TYPE_STRING);
}
 
But if I am removing this query parameter (derivedInventoryStatus = 'BackOrder' ) from the query then I am getting complete result but that result having with Property value like this ("derivedinventorystatus": "String.class")
 
I think it's not a indexing issue, may be I need to update my query? actually, I need to fetch only those result that having derivedInventoryStatus = 'BackOrder'
1 Accepted Solution

Avatar

Correct answer by
Level 4

Hi @Abhishekty 

 

I believe this is an indexing issue only. You need to create an index for derivedInventoryStatus property.

Note: you can change [nt:unstructured]  in your query to type of node you are searching for eg: [cq:Page],if required.

 

you can try below link for creating index: https://experienceleague.adobe.com/docs/experience-manager-65/deploying/deploying/queries-and-indexi...

 

 

Thanks!

View solution in original post

2 Replies

Avatar

Correct answer by
Level 4

Hi @Abhishekty 

 

I believe this is an indexing issue only. You need to create an index for derivedInventoryStatus property.

Note: you can change [nt:unstructured]  in your query to type of node you are searching for eg: [cq:Page],if required.

 

you can try below link for creating index: https://experienceleague.adobe.com/docs/experience-manager-65/deploying/deploying/queries-and-indexi...

 

 

Thanks!

Avatar

Level 4

 

Thanks Rohit !!

 

Screenshot 2021-09-21 at 3.30.28 PM.png

I have create the index and Exception has been resolved now but some how not getting any result.

 

But if I am removing this query parameter (derivedInventoryStatus = 'BackOrder' ) from the query then I am getting complete result but that result having with Property value like this ("derivedinventorystatus": "String.class")

 

Thanks.