discard nofulltexdtsearch
This commit is contained in:
@@ -49,9 +49,7 @@ class SearchParams
|
||||
|
||||
public const ORDER_DESC = 'DESC';
|
||||
|
||||
private function __construct()
|
||||
{
|
||||
}
|
||||
private function __construct() {}
|
||||
|
||||
/**
|
||||
* @return array<string,mixed>
|
||||
@@ -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;
|
||||
|
||||
@@ -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()
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -94,11 +94,7 @@ class Applier
|
||||
$forceFullTextSearch = true;
|
||||
}
|
||||
|
||||
$fullTextSearchData = null;
|
||||
|
||||
if (!$params->noFullTextSearch()) {
|
||||
$fullTextSearchData = $this->composeFullTextSearchData($filter);
|
||||
}
|
||||
|
||||
$fullTextWhere = $fullTextSearchData ?
|
||||
$this->processFullTextSearch($queryBuilder, $fullTextSearchData) :
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user