I want to search minimum of the negotiated_rate where negotiated type is not percentage. I used must not query to filter out percentage but this results to excluding the whole document.
Here I expect the minimum negotiated_rate to be 20.(from the second document)
Below are the 2 sample documents in my index:
"_source": {
"billing_code": "11602",
"proc_details": [
{
"negotiated_rate": 400,
"negotiated_type": "fee schedule",
},
{
"negotiated_rate": 262,
"negotiated_type": "fee schedule",
}
],
}
{
"_source": {
"billing_code": "11602",
"proc_details": [
{"negotiated_rate": 100,
"negotiated_type": "percentage",
},
{
"negotiated_rate": 20,
"negotiated_type": "fee schedule",
}
],
},
}