Skip to content

Fixed SearchNestedFieldsTest test #704

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use Meilisearch\Endpoints\Indexes;
use Tests\TestCase;

final class SearchTestNestedFields extends TestCase
final class SearchNestedFieldsTest extends TestCase
{
private Indexes $index;

Expand All @@ -16,7 +16,7 @@ protected function setUp(): void
parent::setUp();
$this->index = $this->createEmptyIndex($this->safeIndexName('nestedIndex'));
$promise = $this->index->updateDocuments(self::NESTED_DOCUMENTS);
$this->index->waitForTask($promise['uid']);
$this->index->waitForTask($promise['taskUid']);
}

public function testBasicSearchOnNestedFields(): void
Expand Down Expand Up @@ -48,7 +48,7 @@ public function testSearchOnNestedFieldWithMultiplesResultsOnNestedFields(): voi

self::assertArrayHasKey('hits', $response);
self::assertSame(6, $response['estimatedTotalHits']);
self::assertSame(4, $response['hits'][0]['id']);
self::assertSame(1, $response['hits'][0]['id']);
}

public function testSearchOnNestedFieldWithOptions(): void
Expand All @@ -62,13 +62,13 @@ public function testSearchOnNestedFieldWithOptions(): void
]);

self::assertCount(1, $response['hits']);
self::assertSame(4, $response['hits'][0]['id']);
self::assertSame(1, $response['hits'][0]['id']);
}

public function testSearchOnNestedFieldWithSearchableAtributes(): void
{
$response = $this->index->updateSearchableAttributes(['title', 'info.comment']);
$this->index->waitForTask($response['uid']);
$this->index->waitForTask($response['taskUid']);

$response = $this->index->search('An awesome');

Expand All @@ -87,7 +87,7 @@ public function testSearchOnNestedFieldWithSearchableAtributes(): void
public function testSearchOnNestedFieldWithSortableAtributes(): void
{
$response = $this->index->updateSortableAttributes(['info.reviewNb']);
$this->index->waitForTask($response['uid']);
$this->index->waitForTask($response['taskUid']);

$response = $this->index->search('An awesome');

Expand All @@ -111,7 +111,7 @@ public function testSearchOnNestedFieldWithSortableAtributesAndSearchableAttribu
'searchableAttributes' => ['title', 'info.comment'],
'sortableAttributes' => ['info.reviewNb'],
]);
$this->index->waitForTask($response['uid']);
$this->index->waitForTask($response['taskUid']);

$response = $this->index->search('An awesome');

Expand Down
Loading