From bf789fd1a06b5fff09f6f3f0a2744e6f4885572b Mon Sep 17 00:00:00 2001
From: Alex Pott <alex.a.pott@googlemail.com>
Date: Fri, 2 Oct 2020 13:03:18 +0100
Subject: [PATCH] Issue #3173873 by shetpooja04: Unused variable $pos in
 SearchQuery.php, search module

(cherry picked from commit e0c3bb56f63c1a32dc90035f7bae8c83b141cefb)
---
 core/modules/search/src/SearchQuery.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/core/modules/search/src/SearchQuery.php b/core/modules/search/src/SearchQuery.php
index 6e342ca202c1..bba7fe9c0379 100644
--- a/core/modules/search/src/SearchQuery.php
+++ b/core/modules/search/src/SearchQuery.php
@@ -520,7 +520,7 @@ public function addScore($score, $arguments = [], $multiply = FALSE) {
     // search expression. So, use string replacement to change this to a
     // calculated query expression, counting the number of occurrences so
     // in the execute() method we can add arguments.
-    while (($pos = strpos($score, 'i.relevance')) !== FALSE) {
+    while (strpos($score, 'i.relevance') !== FALSE) {
       $pieces = explode('i.relevance', $score, 2);
       $score = implode('((ROUND(:normalization_' . $this->relevance_count . ', 4)) * i.score * t.count)', $pieces);
       $this->relevance_count++;
-- 
GitLab