Q:

Lucene query where two fields will be compared

I have an elasticsearch cluster. All documents in the cluster have the same index and type. Each document has two number fields -> field1 and field2. 
I want to display all documents in Grafana, where value of field1 > value of field2. 
Is there a query like: 
document_type:test AND field1 > field2 ?

A:

As far as I'm aware there is no way to perform that sort of query using elasticsearch (lucene).  It does support range queries, but not comparison between different fields in the document.

