Skip to content

Commit 3f90605

Browse files
committed
BUGFIX: Use multi_match instead of query_string
By using ``multi_match`` instead of ``query_string`` within our search query, we prevent the accidental injection of Lucene search query strings. Currently an exception is thrown when adding ``"`` to your search query. Using ``multi_match`` instead should lead to the same quality of results and is less prone to user errors, because in 99% of cases the search is used for classic search terms and no end user is expected to know the compact Lucene query string syntax. see: https://www.elastic.co/guide/en/elasticsearch/reference/5.6/query-dsl-multi-match-query.html see: https://www.elastic.co/guide/en/elasticsearch/reference/5.6/query-dsl-query-string-query.html see: https://www.elastic.co/guide/en/elasticsearch/reference/5.6/query-dsl-query-string-query.html#query-string-syntax
1 parent 618da54 commit 3f90605

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Classes/Driver/Version5/Query/FilteredQuery.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ public function fulltext(string $searchWord, array $options = []): void
6161
{
6262
$this->appendAtPath('query.bool.must', [
6363
'query_string' => array_merge($options, [
64+
// 'multi_match' => array_merge($options, [
6465
'query' => $searchWord,
6566
'fields' => ['__fulltext*']
6667
])

0 commit comments

Comments
 (0)