mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-23 18:03:17 +00:00
PHRAS-2805 #comment Port41 of Facet-case-sensibility
This commit is contained in:
@@ -323,7 +323,7 @@ class ElasticsearchOptions
|
||||
"aggregated (2 values: fired = 0 or 1)" => -1,
|
||||
],
|
||||
'output_formatter' => function($value) {
|
||||
static $map = ['0'=>"No flash", '1'=>"Flash"];
|
||||
static $map = ["false"=>"No flash", "true"=>"Flash", '0'=>"No flash", '1'=>"Flash"];
|
||||
return array_key_exists($value, $map) ? $map[$value] : $value;
|
||||
},
|
||||
],
|
||||
|
||||
@@ -4,6 +4,11 @@ namespace Alchemy\Phrasea\SearchEngine\Elastic\Search;
|
||||
|
||||
class Escaper
|
||||
{
|
||||
public function quoteWord($value)
|
||||
{
|
||||
return '"' . $this->escapeRaw($value) . '"';
|
||||
}
|
||||
|
||||
public function escapeWord($value)
|
||||
{
|
||||
// Strip double quotes from values to prevent broken queries
|
||||
|
||||
@@ -62,7 +62,7 @@ class FacetsResponse
|
||||
'value' => $key,
|
||||
'raw_value' => $key,
|
||||
'count' => $bucket['doc_count'],
|
||||
'query' => sprintf('field.%s:%s', $this->escaper->escapeWord($name), $this->escaper->escapeWord($key))
|
||||
'query' => sprintf('field.%s=%s', $this->escaper->escapeWord($name), $this->escaper->quoteWord($key))
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user