I have an index of data in Manticore that includes a JSON field (called readings
that is structured like this:
{
"temperature": 12.3,
"light": 45.5,
"battery": 3422,
....
}
I'm wanting to facet the results such that I can display counts of rows matching temperature, light etc. For example:
Readings
- Temperature (1,305)
- Light (845)
- Battery (243)
It's important that I'm able to get the "keys" of the array to facet by (as I don't want to hard code the list of keys in my query, it should ideally be dynamic).
I can't work out how to query so Manticore FACETs on the key of the array. I was hoping for something like:
SELECT * FROM readings_data FACET readings.KEYNAME;
...where KEYNAME is something magical to represent the key of the array element. Is that possible?
I can restructure my JSON array if required, to make it easier to work with.
Thanks for any help or suggestions you can offer.