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

Query is not returning any value when I am filtered by dropdown value

Avatar

Level 4

I have written a query for that I have also define the index  and it is executing correctly but not getting results.

my thought is, property which I am filtering that is set by in aem commerce a dropdown that why it is not able to match but if am filtering a property which set simple text then I am getting results.

 

for example :

my object look like below:

 

{
"data": [
[{
"datatype": "DeviceDataUse",
"values": {
"defaultskuid": "141200172",

"identifier": "dvc12080008prd",
"storageunit": "GB",
"availabilitystatus": "Sellable",
"tinynoborder": "xx",
"skuimages": ["xx"]
}
}, {
"datatype": "DeviceSkuDataUse",
"values": {
"halfsize": "xx",
"identifier": "128000055",
"image": ["xx"],
"hexcode": "#1F2120",
"derivedinventorystatus": "BackOrder",
"availabilitystatus": "Supported",
"fullsizeborderlesspng": "xx"
},
"pageUrl": "xx"
}]
]
}

 

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

 

for "identifier" it is working fine.

 

// queryString = "SELECT * FROM [nt:unstructured] AS s WHERE (ISDESCENDANTNODE(s, [/etc/commerce/products/myProject/en/devices])) and (identifier is not null)";

 

Screenshot 2021-09-24 at 11.52.06 AM.png

1 Accepted Solution

Avatar

Correct answer by
Level 4

Recreate index for the same property and then reindex. It will work.

View solution in original post

7 Replies

Avatar

Level 4

Hi @Abhishekty 

 

Can you change s.derivedInventoryStatus to s.derivedinventorystatus

 

Thanks!

Avatar

Level 4

After changing the name I believe you have to update the index as well with the correct name as derivedinventorystatus and reindex.

There is nothing wrong in your query, I ran the same on my end as well, and it is working fine.

 

Thanks!

Avatar

Level 4

Yes, I already did the same steps. but still facing the same issue.

Screenshot 2021-09-24 at 1.35.16 PM.png

 

 

Avatar

Correct answer by
Level 4

Recreate index for the same property and then reindex. It will work.