My query has a giving exception error, an error occurred while explaining the query even getting null data. | Community
Skip to main content
Abhishekty
Level 4
September 21, 2021
Solved

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

  • September 21, 2021
  • 1 reply
  • 981 views

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'
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Rohit-Negi

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-indexing.html?lang=en

 

 

Thanks!

1 reply

Rohit-Negi
Rohit-NegiAccepted solution
Level 3
September 21, 2021

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-indexing.html?lang=en

 

 

Thanks!

Abhishekty
Level 4
September 21, 2021

 

Thanks Rohit !!

 

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.