diff --git a/application/Espo/Core/Select/SearchParams.php b/application/Espo/Core/Select/SearchParams.php index ccf8fa6c77..95f159cd39 100644 --- a/application/Espo/Core/Select/SearchParams.php +++ b/application/Espo/Core/Select/SearchParams.php @@ -385,11 +385,7 @@ class SearchParams $rawParams['primaryFilter'] = $primaryFilter; $rawParams['textFilter'] = $textFilter; $rawParams['where'] = $where; - $rawParams['noFullTextSearch'] = false; - - $rawParams['noFullTextSearch'] = isset($params['q']); - $rawParams['maxTextAttributeLength'] = $maxTextAttributeLength; if ($where) { diff --git a/application/Espo/Core/Select/Text/FullTextSearchDataComposer.php b/application/Espo/Core/Select/Text/FullTextSearchDataComposer.php index 0278d9e11b..9db44c7c65 100644 --- a/application/Espo/Core/Select/Text/FullTextSearchDataComposer.php +++ b/application/Espo/Core/Select/Text/FullTextSearchDataComposer.php @@ -70,8 +70,7 @@ class FullTextSearchDataComposer $useFullTextSearch = false; if ( - $this->metadataProvider->hasFullTextSearch($this->entityType) - && + $this->metadataProvider->hasFullTextSearch($this->entityType) && !empty($fullTextSearchColumnList) ) { $fullTextSearchMinLength = $this->config->get('fullTextSearchMinLength') ?? self::MIN_LENGTH; @@ -80,11 +79,13 @@ class FullTextSearchDataComposer $fullTextSearchMinLength = 0; } - $filterWoWildcards = str_replace('*', '', $filter); + /*$filterWoWildcards = str_replace('*', '', $filter); if (mb_strlen($filterWoWildcards) >= $fullTextSearchMinLength) { $useFullTextSearch = true; - } + }*/ + + $useFullTextSearch = true; } $fullTextSearchFieldList = []; @@ -140,12 +141,9 @@ class FullTextSearchDataComposer if ( $isAuxiliaryUse && mb_strpos($filter, '*') === false || - mb_strpos($filter, ' ') === false - && - mb_strpos($filter, '+') === false - && - mb_strpos($filter, '-') === false - && + mb_strpos($filter, ' ') === false && + mb_strpos($filter, '+') === false && + mb_strpos($filter, '-') === false && mb_strpos($filter, '*') === false ) { $function = 'MATCH_NATURAL_LANGUAGE'; @@ -156,7 +154,6 @@ class FullTextSearchDataComposer $filter = str_replace('"*', '"', $filter); $filter = str_replace('*"', '"', $filter); - $filter = str_replace('\'', '\'\'', $filter); while (strpos($filter, '**')) { diff --git a/tests/unit/Espo/Core/Select/SearchParamsTest.php b/tests/unit/Espo/Core/Select/SearchParamsTest.php index 7215532dec..5ab4b1c000 100644 --- a/tests/unit/Espo/Core/Select/SearchParamsTest.php +++ b/tests/unit/Espo/Core/Select/SearchParamsTest.php @@ -100,7 +100,7 @@ class SearchParamsTest extends \PHPUnit\Framework\TestCase $this->assertEquals('test', $params->getTextFilter()); - $this->assertTrue($params->noFullTextSearch()); + $this->assertFalse($params->noFullTextSearch()); } public function testOrder()