mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-16 14:33:14 +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'])) {
|
if (!isset($bucket['key']) || !isset($bucket['doc_count'])) {
|
||||||
$this->throwAggregationResponseError();
|
$this->throwAggregationResponseError();
|
||||||
}
|
}
|
||||||
|
$key = array_key_exists('key_as_string', $bucket) ? $bucket['key_as_string'] : $bucket['key'];
|
||||||
if($tf) {
|
if($tf) {
|
||||||
// the field is one of the hardcoded tech fields
|
// the field is one of the hardcoded tech fields
|
||||||
$value = [
|
$value = [
|
||||||
'value' => $valueFormatter($bucket['key']),
|
'value' => $valueFormatter($key),
|
||||||
'raw_value' => $bucket['key'],
|
'raw_value' => $key,
|
||||||
'count' => $bucket['doc_count'],
|
'count' => $bucket['doc_count'],
|
||||||
'query' => sprintf($tf['query'], $this->escaper->escapeWord($bucket['key']))
|
'query' => sprintf($tf['query'], $this->escaper->escapeWord($key))
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// the field is a normal field
|
// the field is a normal field
|
||||||
$value = [
|
$value = [
|
||||||
'value' => $bucket['key'],
|
'value' => $key,
|
||||||
'raw_value' => $bucket['key'],
|
'raw_value' => $key,
|
||||||
'count' => $bucket['doc_count'],
|
'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