mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-15 22:13:13 +00:00
PHRAS-2785 #comment Port41 of PHRAS-2758 #time 1h
This commit is contained in:
@@ -46,22 +46,23 @@ class FacetsResponse
|
||||
if (!isset($bucket['key']) || !isset($bucket['doc_count'])) {
|
||||
$this->throwAggregationResponseError();
|
||||
}
|
||||
$key = array_key_exists('key_as_string', $bucket) ? $bucket['key_as_string'] : $bucket['key'];
|
||||
if($tf) {
|
||||
// the field is one of the hardcoded tech fields
|
||||
$value = [
|
||||
'value' => $valueFormatter($bucket['key']),
|
||||
'raw_value' => $bucket['key'],
|
||||
'value' => $valueFormatter($key),
|
||||
'raw_value' => $key,
|
||||
'count' => $bucket['doc_count'],
|
||||
'query' => sprintf($tf['query'], $this->escaper->escapeWord($bucket['key']))
|
||||
'query' => sprintf($tf['query'], $this->escaper->escapeWord($key))
|
||||
];
|
||||
}
|
||||
else {
|
||||
// the field is a normal field
|
||||
$value = [
|
||||
'value' => $bucket['key'],
|
||||
'raw_value' => $bucket['key'],
|
||||
'value' => $key,
|
||||
'raw_value' => $key,
|
||||
'count' => $bucket['doc_count'],
|
||||
'query' => sprintf('field.%s:%s', $this->escaper->escapeWord($name), $this->escaper->escapeWord($bucket['key']))
|
||||
'query' => sprintf('field.%s:%s', $this->escaper->escapeWord($name), $this->escaper->escapeWord($key))
|
||||
];
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user