Custom score with isolines

Hi there !,

We have 1M docs representing geolocalized polluting companies with the geographical diffusion of their pollution using isoline polygons

for instance

to simplify we use rectangular area , check this drawing

We currently have the following mapping (you can change it if you think it's not relevant for the pb)
doc ={

  • 10units_isoline = polygon # the area where the pollution generated by this company is about 10 units
  • 20units_isoline = polygon # the area where the pollution generated by this company is about 20 units
  • 30units_isoline = polygon# the area where the pollution generated by this company is about 30 units
  • ..
    }

I dont manage to find the query to retrieve the top 10 companies that are the less polluting near a given point. In our context, we prefer documents where the queried point matches the polygon of the 10units_isoline field more than a polygon of the 30units_isoline field of another doc.

More specially (this is the difficult part) when we retrieve the TOP 10 document I want to know for each document what is the associated pollution isoline of this company at that particular point.

any direction / suggestion / similar examples where to search to get

(is ES the right tool for such query?)

Thanks in advance !

Nicolas