I'm working on Magento 2.4.2 with Elasticsearch 7.6. I've tried to add a sorting option on the category page which will sort the products on the basis of quantity added in the product.
I've checked multiple posts on StackOverflow and tried multiple things to achieve this but didn't get the expected results.
Elasticsearch\\Common\\Exceptions\\BadRequest400Exception(code: 400): {\"error\":{\"root_cause\":[{\"type\":\"query_shard_exception\",\"reason\":\"No mapping found for [availability.sort_availability] in order to sort on
Can anybody let me know how to sort products on the basis of quantity in Magento 2.4.