Hi, I have a table with the following structure
[
'id' => ['type' => 'bigint'],
'article_id' => ['type' => 'bigint'],
'journal_id' => ['type' => 'bigint'],
...
'subjects' => ['type' => 'json'],
'countries' => ['type' => 'json'],
]
countries column contains JSONs consisting of countries ids (country_id >= 1 and <= 255), like this
[1,3,234]
[2,3]
[2,3,4,67,55,136]
[4]
...
When I use facet on countries field I get the result looking like the following
[
0 => [
'key' => [1,3,234],
'doc_count' => 1
],
1 => [
'key' => [2,3],
'doc_count' => 345
],
2 => [
'key' => [4],
'doc_count' => 45
],
...
]
Is it possible within Manticore to group result by countries JSON values not JSON strings? So I want each key to be equal to country_id and doc_count to be equal to the number of documents where countries JSON contains country_id, like this
[
0 => [
'key' => 1, // country_id
'doc_count' => 15
],
1 => [
'key' => 3, // country_id
'doc_count' => 33
],
2 => [
'key' => 4, // country_id
'doc_count' => 445
],
...
]