mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-24 02:13:15 +00:00
PHRAS-2805 #comment Port41 of Facet-case-sensibility
This commit is contained in:
@@ -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