How to store ranges in Elasticsearch Part 2
Read part 1 of this series here.
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.
Thanks to the person who answered my question on Stack Overflow. It helped me make progress when I was completely stuck.