From 8c9a09985f23fc466f1c9bcfbe827fe374363c43 Mon Sep 17 00:00:00 2001 From: Alexey Ershov Date: Wed, 9 Aug 2017 13:23:41 +0500 Subject: [PATCH] when includeTVs == false then not add tvs in where; --- .../driver/simplesearchdriverbasic.class.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/core/components/simplesearch/model/simplesearch/driver/simplesearchdriverbasic.class.php b/core/components/simplesearch/model/simplesearch/driver/simplesearchdriverbasic.class.php index 59446e2..9b26cdc 100755 --- a/core/components/simplesearch/model/simplesearch/driver/simplesearchdriverbasic.class.php +++ b/core/components/simplesearch/model/simplesearch/driver/simplesearchdriverbasic.class.php @@ -120,8 +120,14 @@ public function search($str,array $scriptProperties = array()) { } } else { $term = $wildcard.$this->searchString.$wildcard; - foreach ($docFields as $field) {$whereArray[] = array($field.':LIKE', $term,xPDOQuery::SQL_OR,$whereGroup);} - $whereArray[] = array('TemplateVarResources.value:LIKE', $term, xPDOQuery::SQL_OR, $whereGroup); + foreach ($docFields as $field) { + $whereArray[] = array($field.':LIKE', $term, xPDOQuery::SQL_OR, $whereGroup); + } + + if ($includeTVs) { + $whereArray[] = array('TemplateVarResources.value:LIKE', $term, xPDOQuery::SQL_OR, $whereGroup); + } + if (is_array($customPackages) && !empty($customPackages)) { foreach ($customPackages as $package) { $fields = explode(',',$package[1]); @@ -272,4 +278,4 @@ public function addRelevancyCondition(&$query, $options) { return true; } -} +} \ No newline at end of file