Query assistance for conditional querying

I have elastic index with fields styleId, sellingStyleId, styleName, inventoryEnabled, inventoryCount

need help with query to pull all the records but if inventoryEnabled is true then check if inventoryCount is greater than 10 else if inventoryEnabled is not true or null then pick that record and do not check for inventoryCount

I don't think there is a way to pipeline queries in Elasticsearch. Maybe you can take a look at multi search API and collate the responses in the backend outside of Elasticsearch

1 Like