aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/phinde/Elasticsearch.php5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/phinde/Elasticsearch.php b/src/phinde/Elasticsearch.php
index 5ca2180..fd60f95 100644
--- 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',