Last time we saw how to use range fields to store range values in Elasticsearch. You could store two discontinuous brightness ranges supported by a TV operating in two modes (SDR and HDR). However, we did not associate the ranges with their respective modes.
To do that properly, we need to make use of nested types in Elasticsearch.
Let’s put in the same TVs as last time, but with the mode information attached.
Now we can query for a specific brightness range in a particular mode. So let’s search for a TV that supports 600 to 700 nits in the HDR mode.
This will return the LG TV since it is the only one that supports our required brightness in the HDR mode.