add label and es_term on field last_term

This commit is contained in:
vnmedeiros 2020-06-29 11:19:46 -03:00
parent a1f52ea9bf
commit 8eefeae7be
1 changed files with 5 additions and 1 deletions

View File

@ -370,7 +370,11 @@ class Elastic_Press {
// 'total' => count($items_aggregations),
// 'pages' => '0', //TODO get a total of pages
'values' => isset($items_aggregations['values']) ? $items_aggregations['values'] : [] ,
'last_term' => isset($items_aggregations['last_term']) ? $items_aggregations['last_term'] : ''
'last_term' => isset($items_aggregations['last_term']) ?
[
'label' => explode('.', $items_aggregations['last_term'])[0],
'es_term'=>$items_aggregations['last_term']
] : ''
];
}