Variable: Return all Elastic documents when selecting "All" and the attribute might be an empty list

I’m using Grafana 8.2.6 on Docker image grafana/grafana-oss:8.2.6.

My data source is Elastic. I want to create a multi-value variable that will be filtering the data based on an attribute (provision_org) which is a list. I’ve done that, and I’ve named the variable $provision_org and it generally works, but I’m having trouble with the “All” option.

This is my “Lucene” query: provision_org.keyword:$provision_org. I’ve specified “custom All option”, and I’m trying to figure out what that custom All option should be. That is, what value $provision_org should have in order to always match. If I use *, all documents that have a provision_org match, but the documents for which provision_org is an empty list don’t match. I can’t figure out any way to solve this problem (other than modifying the data in Elastic so that provision_org is something like “None” instead of an empty list, but this looks like a silly hack).

(I’ve also asked this on stackoverflow with a bounty, but no-one seems to have the answer.)

how would this query look like in lucene outside of grafana? for All that is