-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upd package for MeiliSearch v0.11 (#35)
* Upd version * Add method to use faceting sub routes (#36) * Implement faceting in search (#37) * Change create_index prototype (#39) * Add test with multiple facetFilters (#38)
- Loading branch information
Showing
12 changed files
with
210 additions
and
63 deletions.
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
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 |
---|---|---|
|
@@ -4,5 +4,5 @@ | |
|
||
class MeiliSearch | ||
{ | ||
const VERSION = '0.10.2'; | ||
const VERSION = '0.11.0'; | ||
} |
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
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,59 @@ | ||
<?php | ||
|
||
namespace Tests\Settings; | ||
|
||
use Tests\TestCase; | ||
|
||
class AttributesForFacetingTest extends TestCase | ||
{ | ||
protected function setUp(): void | ||
{ | ||
parent::setUp(); | ||
$this->client->deleteAllIndexes(); | ||
} | ||
|
||
public function testGetDefaultAttributesForFaceting() | ||
{ | ||
$index = $this->client->createIndex('index'); | ||
|
||
$attributes = $index->getAttributesForFaceting(); | ||
|
||
$this->assertIsArray($attributes); | ||
$this->assertEmpty($attributes); | ||
} | ||
|
||
public function testUpdateAttributesForFaceting() | ||
{ | ||
$newAttributes = ['title']; | ||
$index = $this->client->createIndex('index'); | ||
|
||
$promise = $index->updateAttributesForFaceting($newAttributes); | ||
|
||
$this->assertIsValidPromise($promise); | ||
$index->waitForPendingUpdate($promise['updateId']); | ||
|
||
$attributesForFaceting = $index->getAttributesForFaceting(); | ||
|
||
$this->assertIsArray($attributesForFaceting); | ||
$this->assertEquals($newAttributes, $attributesForFaceting); | ||
} | ||
|
||
public function testResetAttributesForFaceting() | ||
{ | ||
$index = $this->client->createIndex('index'); | ||
$newAttributes = ['title']; | ||
|
||
$promise = $index->updateAttributesForFaceting($newAttributes); | ||
$index->waitForPendingUpdate($promise['updateId']); | ||
|
||
$promise = $index->resetAttributesForFaceting(); | ||
|
||
$this->assertIsValidPromise($promise); | ||
|
||
$index->waitForPendingUpdate($promise['updateId']); | ||
|
||
$attributesForFaceting = $index->getAttributesForFaceting(); | ||
$this->assertIsArray($attributesForFaceting); | ||
$this->assertEmpty($attributesForFaceting); | ||
} | ||
} |
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
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
Oops, something went wrong.