diff --git a/core/modules/search/src/SearchQuery.php b/core/modules/search/src/SearchQuery.php
index 6869da434f..84a1a88d6e 100644
--- a/core/modules/search/src/SearchQuery.php
+++ b/core/modules/search/src/SearchQuery.php
@@ -318,7 +318,7 @@ protected function parseSearchExpression() {
         foreach ($key as $or) {
           [$num_new_scores] = $this->parseWord($or);
           $has_new_scores |= $num_new_scores;
-          $queryor->condition('d.data', "% $or %", 'LIKE');
+          $queryor->condition('d.data', "%$or%", 'LIKE');
         }
         if (count($queryor)) {
           $this->conditions->condition($queryor);
@@ -330,7 +330,7 @@ protected function parseSearchExpression() {
       else {
         $has_and = TRUE;
         [$num_new_scores, $num_valid_words] = $this->parseWord($key);
-        $this->conditions->condition('d.data', "% $key %", 'LIKE');
+        $this->conditions->condition('d.data', "%$key%", 'LIKE');
         if (!$num_valid_words) {
           $this->simple = FALSE;
         }
@@ -344,7 +344,7 @@ protected function parseSearchExpression() {
 
     // Negative matches.
     foreach ($this->keys['negative'] as $key) {
-      $this->conditions->condition('d.data', "% $key %", 'NOT LIKE');
+      $this->conditions->condition('d.data', "%$key%", 'NOT LIKE');
       $this->simple = FALSE;
     }
   }
@@ -404,7 +404,7 @@ public function prepareAndNormalize() {
     // Build the basic search query: match the entered keywords.
     $or = $this->connection->condition('OR');
     foreach ($this->words as $word) {
-      $or->condition('i.word', $word);
+      $or->condition('i.word', '%'. $word .'%', 'LIKE');
     }
     $this->condition($or);
 
