-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #702 from meilisearch/feat/add-v1.12-settings
Add `prefixSearch` and `facetSearch` index settings
- Loading branch information
Showing
4 changed files
with
166 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Tests\Settings; | ||
|
||
use Tests\TestCase; | ||
|
||
final class FacetSearchTest extends TestCase | ||
{ | ||
public function testGetDefaultFacetSearch(): void | ||
{ | ||
$index = $this->createEmptyIndex($this->safeIndexName()); | ||
|
||
$facetSearch = $index->getFacetSearch(); | ||
|
||
self::assertTrue($facetSearch); | ||
} | ||
|
||
public function testUpdateFacetSearch(): void | ||
{ | ||
$index = $this->createEmptyIndex($this->safeIndexName()); | ||
|
||
$promise = $index->updateFacetSearch(false); | ||
|
||
$this->assertIsValidPromise($promise); | ||
$index->waitForTask($promise['taskUid']); | ||
|
||
$facetSearch = $index->getFacetSearch(); | ||
self::assertFalse($facetSearch); | ||
} | ||
|
||
public function testResetFacetSearch(): void | ||
{ | ||
$index = $this->createEmptyIndex($this->safeIndexName()); | ||
|
||
$promise = $index->updateFacetSearch(false); | ||
$index->waitForTask($promise['taskUid']); | ||
|
||
$promise = $index->resetFacetSearch(); | ||
|
||
$this->assertIsValidPromise($promise); | ||
|
||
$index->waitForTask($promise['taskUid']); | ||
|
||
$facetSearch = $index->getFacetSearch(); | ||
self::assertTrue($facetSearch); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Tests\Settings; | ||
|
||
use Tests\TestCase; | ||
|
||
final class PrefixSearchTest extends TestCase | ||
{ | ||
public function testGetDefaultPrefixSearch(): void | ||
{ | ||
$index = $this->createEmptyIndex($this->safeIndexName()); | ||
|
||
$prefixSearch = $index->getPrefixSearch(); | ||
|
||
self::assertSame('indexingTime', $prefixSearch); | ||
} | ||
|
||
public function testUpdatePrefixSearch(): void | ||
{ | ||
$index = $this->createEmptyIndex($this->safeIndexName()); | ||
|
||
$promise = $index->updatePrefixSearch('disabled'); | ||
|
||
$this->assertIsValidPromise($promise); | ||
$index->waitForTask($promise['taskUid']); | ||
|
||
$prefixSearch = $index->getPrefixSearch(); | ||
self::assertSame('disabled', $prefixSearch); | ||
} | ||
|
||
public function testResetPrefixSearch(): void | ||
{ | ||
$index = $this->createEmptyIndex($this->safeIndexName()); | ||
|
||
$promise = $index->updatePrefixSearch('disabled'); | ||
$index->waitForTask($promise['taskUid']); | ||
|
||
$promise = $index->resetPrefixSearch(); | ||
|
||
$this->assertIsValidPromise($promise); | ||
|
||
$index->waitForTask($promise['taskUid']); | ||
|
||
$prefixSearch = $index->getPrefixSearch(); | ||
self::assertSame('indexingTime', $prefixSearch); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters