git.cweiske.de
/
phinde.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d3cdabc
)
Do not break when searching for slashes
author
Christian Weiske
<
[email protected]
>
Sat, 29 Feb 2020 21:24:32 +0000
(22:24 +0100)
committer
Christian Weiske
<
[email protected]
>
Sat, 29 Feb 2020 21:24:32 +0000
(22:24 +0100)
Resolves: https://github.com/cweiske/phinde/issues/36
src/phinde/Elasticsearch.php
patch
|
blob
|
history
diff --git
a/src/phinde/Elasticsearch.php
b/src/phinde/Elasticsearch.php
index 5ca2180c8b66a936d731f8e34691af2385a95174..fd60f95a53ebfe8051825ba941b502c028c285c1 100644
(file)
--- a/
src/phinde/Elasticsearch.php
+++ b/
src/phinde/Elasticsearch.php
@@
-122,6
+122,11
@@
class Elasticsearch
);
}
+ if (strpos($query, '/') !== false && strpos($query, '"') === false) {
+ //add quotes when there is a slash and no quotes
+ // https://stackoverflow.com/questions/31963643/escaping-forward-slashes-in-elasticsearch
+ $query = '"' . $query . '"';
+ }
$qMust[] = array(
'query_string' => array(
'default_field' => '_all',