diff --git a/src/API/QueryBuilder.php b/src/API/QueryBuilder.php
index <HASH>..<HASH> 100755
--- a/src/API/QueryBuilder.php
+++ b/src/API/QueryBuilder.php
@@ -208,6 +208,7 @@ class QueryBuilder extends Injectable
                 }
             }
 
+            $count = 1;
             foreach ($processedSearchFields as $processedSearchField) {
                 switch ($processedSearchField['queryType']) {
                     case 'and':
@@ -251,7 +252,6 @@ class QueryBuilder extends Injectable
                         // update to bind params instead of using string concatination
                         $queryArr = [];
                         $valueArr = [];
-                        $count = 1;
                         foreach ($fieldNameArray as $fieldName) {
                             $fieldName = $this->prependFieldNameNamespace($fieldName);
                             foreach ($fieldValueArray as $fieldValue) {
fix a bug when you pass 2 query params one with field=v1||v2||v3 and another query like f1||f2||f3=*a*