Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

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

Abhishekty
Level 2
Level 2

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
Rohit_Negi550
Correct answer by
Level 4
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
Rohit_Negi550
Correct answer by
Level 4
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

Abhishekty
Level 2
Level 2

 

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.