diff --git a/application/Espo/Core/Select/SearchParams.php b/application/Espo/Core/Select/SearchParams.php index 95f159cd39..af4d941005 100644 --- a/application/Espo/Core/Select/SearchParams.php +++ b/application/Espo/Core/Select/SearchParams.php @@ -49,9 +49,7 @@ class SearchParams public const ORDER_DESC = 'DESC'; - private function __construct() - { - } + private function __construct() {} /** * @return array @@ -122,11 +120,6 @@ class SearchParams ]); } - public function noFullTextSearch(): bool - { - return $this->rawParams['noFullTextSearch']; - } - public function getMaxTextAttributeLength(): ?int { return $this->rawParams['maxTextAttributeLength']; @@ -244,15 +237,6 @@ class SearchParams return $obj; } - public function withNoFullTextSearch(bool $value = true): self - { - $obj = clone $this; - - $obj->rawParams['noFullTextSearch'] = $value; - - return $obj; - } - public function withMaxTextAttributeLength(?int $value): self { $obj = clone $this; @@ -385,7 +369,6 @@ class SearchParams $rawParams['primaryFilter'] = $primaryFilter; $rawParams['textFilter'] = $textFilter; $rawParams['where'] = $where; - $rawParams['noFullTextSearch'] = false; $rawParams['maxTextAttributeLength'] = $maxTextAttributeLength; if ($where) { @@ -421,10 +404,6 @@ class SearchParams } } - if ($leftParams['noFullTextSearch']) { - $params['noFullTextSearch'] = true; - } - foreach ($leftParams['boolFilterList'] as $item) { if (in_array($item, $params['boolFilterList'])) { continue; diff --git a/application/Espo/Core/Select/SelectBuilder.php b/application/Espo/Core/Select/SelectBuilder.php index 228d7c9d11..a3b69468e7 100644 --- a/application/Espo/Core/Select/SelectBuilder.php +++ b/application/Espo/Core/Select/SelectBuilder.php @@ -375,17 +375,11 @@ class SelectBuilder assert($this->queryBuilder !== null); assert($this->textFilter !== null); - $noFullTextSearch = false; - - if ($this->searchParams && $this->searchParams->noFullTextSearch()) { - $noFullTextSearch = true; - } - $this->createTextFilterApplier() ->apply( $this->queryBuilder, $this->textFilter, - TextFilterParams::create()->withNoFullTextSearch($noFullTextSearch) + TextFilterParams::create() ); } diff --git a/application/Espo/Core/Select/Text/Applier.php b/application/Espo/Core/Select/Text/Applier.php index 55f7396f51..0f005e57be 100644 --- a/application/Espo/Core/Select/Text/Applier.php +++ b/application/Espo/Core/Select/Text/Applier.php @@ -94,11 +94,7 @@ class Applier $forceFullTextSearch = true; } - $fullTextSearchData = null; - - if (!$params->noFullTextSearch()) { - $fullTextSearchData = $this->composeFullTextSearchData($filter); - } + $fullTextSearchData = $this->composeFullTextSearchData($filter); $fullTextWhere = $fullTextSearchData ? $this->processFullTextSearch($queryBuilder, $fullTextSearchData) : diff --git a/tests/unit/Espo/Core/Select/SearchParamsTest.php b/tests/unit/Espo/Core/Select/SearchParamsTest.php index 5ab4b1c000..cd5e7428d1 100644 --- a/tests/unit/Espo/Core/Select/SearchParamsTest.php +++ b/tests/unit/Espo/Core/Select/SearchParamsTest.php @@ -73,14 +73,11 @@ class SearchParamsTest extends \PHPUnit\Framework\TestCase $this->assertEquals('test', $params->getTextFilter()); $this->assertEquals('testPrimary', $params->getPrimaryFilter()); $this->assertEquals($raw['where'], $params->getWhere()->getRaw()['value']); - - $this->assertFalse($params->noFullTextSearch()); } public function testFromRawEmpty() { - $params = SearchParams::fromRaw([ - ]); + $params = SearchParams::fromRaw([]); $this->assertEquals(null, $params->getSelect()); $this->assertEquals(null, $params->getOffset()); @@ -99,8 +96,6 @@ class SearchParamsTest extends \PHPUnit\Framework\TestCase ]); $this->assertEquals('test', $params->getTextFilter()); - - $this->assertFalse($params->noFullTextSearch()); } public function testOrder() @@ -289,7 +284,6 @@ class SearchParamsTest extends \PHPUnit\Framework\TestCase 'offset' => null, 'maxSize' => null, 'primaryFilter' => null, - 'noFullTextSearch' => false, 'maxTextAttributeLength' => null, ]; @@ -309,7 +303,6 @@ class SearchParamsTest extends \PHPUnit\Framework\TestCase ->withMaxSize(10) ->withOffset(0) ->withMaxTextAttributeLength(100) - ->withNoFullTextSearch() ->withOrder('DESC') ->withOrderBy('name') ->withPrimaryFilter('test') @@ -321,7 +314,6 @@ class SearchParamsTest extends \PHPUnit\Framework\TestCase $this->assertEquals(10, $params->getMaxSize()); $this->assertEquals(0, $params->getOffset()); $this->assertEquals(100, $params->getMaxTextAttributeLength()); - $this->assertEquals(true, $params->noFullTextSearch()); $this->assertEquals('DESC', $params->getOrder()); $this->assertEquals('name', $params->getOrderBy()); $this->assertEquals('test', $params->getPrimaryFilter()); diff --git a/tests/unit/Espo/Core/Select/Text/FilterParamsTest.php b/tests/unit/Espo/Core/Select/Text/FilterParamsTest.php index a5aeff5de8..492eea6f63 100644 --- a/tests/unit/Espo/Core/Select/Text/FilterParamsTest.php +++ b/tests/unit/Espo/Core/Select/Text/FilterParamsTest.php @@ -35,15 +35,8 @@ class FilterParamsTest extends \PHPUnit\Framework\TestCase { public function testCreate1(): void { - $item = FilterParams::create()->withNoFullTextSearch(true); + $item = FilterParams::create(); - $this->assertTrue($item->noFullTextSearch()); - } - - public function testCreate2(): void - { - $item = FilterParams::create()->withNoFullTextSearch(false); - - $this->assertFalse($item->noFullTextSearch()); + $this->assertNotNull($item); } }