Skip to content

Commit

Permalink
Merge branch 'main' into bump-meilisearch-v0.12.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Strift authored Dec 12, 2024
2 parents 8254856 + e642288 commit 8d6c5f7
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/meilisearch-beta-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
MEILI_NO_ANALYTICS: true
strategy:
matrix:
php-version: ['7.4', '8.0', '8.1', '8.2', '8.3']
php-version: ['7.4', '8.0', '8.1', '8.2', '8.3', '8.4']
http-client: ['Guzzle-7', 'Guzzle-7-Adapter', 'Symfony-HttpClient', 'PHP-HTTP-CurlClient', 'Kriswallsmith-Buzz']
exclude:
- php-version: '7.4'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pre-release-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
MEILI_NO_ANALYTICS: true
strategy:
matrix:
php-version: ['7.4', '8.0', '8.1', '8.2', '8.3']
php-version: ['7.4', '8.0', '8.1', '8.2', '8.3', '8.4']
http-client: ['Guzzle-7', 'Guzzle-7-Adapter', 'Symfony-HttpClient', 'PHP-HTTP-CurlClient', 'Kriswallsmith-Buzz']
exclude:
- php-version: '7.4'
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,16 @@ jobs:
lint:
runs-on: ubuntu-latest
name: linter-check
env:
PHP_CS_FIXER_IGNORE_ENV: 1
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.3
php-version: 8.4
coverage: none

- name: Install dependencies
Expand All @@ -52,7 +54,7 @@ jobs:
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.2
php-version: 8.4
coverage: none

- name: Install dependencies
Expand All @@ -77,7 +79,7 @@ jobs:
MEILI_NO_ANALYTICS: true
strategy:
matrix:
php-version: ['7.4', '8.0', '8.1', '8.2', '8.3']
php-version: ['7.4', '8.0', '8.1', '8.2', '8.3', '8.4']
http-client: ['Guzzle-7', 'Guzzle-7-Adapter', 'Symfony-HttpClient', 'PHP-HTTP-CurlClient', 'Kriswallsmith-Buzz']
exclude:
- php-version: '7.4'
Expand Down
6 changes: 6 additions & 0 deletions bors.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ status = [
'integration-tests (PHP 8.3) (Symfony-HttpClient)',
'integration-tests (PHP 8.3) (PHP-HTTP-CurlClient)',
'integration-tests (PHP 8.3) (Kriswallsmith-Buzz)',

'integration-tests (PHP 8.4) (Guzzle-7)',
'integration-tests (PHP 8.4) (Guzzle-7-Adapter)',
'integration-tests (PHP 8.4) (Symfony-HttpClient)',
'integration-tests (PHP 8.4) (PHP-HTTP-CurlClient)',
'integration-tests (PHP 8.4) (Kriswallsmith-Buzz)',
]
# 1 hour timeout
timeout-sec = 3600
3 changes: 1 addition & 2 deletions src/Search/SearchResult.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,19 +58,18 @@ public function __construct(array $body)
$this->offset = $body['offset'];
$this->limit = $body['limit'];
$this->estimatedTotalHits = $body['estimatedTotalHits'];
$this->hitsCount = \count($body['hits']);
} else {
$this->numberedPagination = true;

$this->hitsPerPage = $body['hitsPerPage'];
$this->page = $body['page'];
$this->totalPages = $body['totalPages'];
$this->totalHits = $body['totalHits'];
$this->hitsCount = $body['totalHits'];
}

$this->semanticHitCount = $body['semanticHitCount'] ?? 0;
$this->hits = $body['hits'] ?? [];
$this->hitsCount = \count($body['hits']);
$this->processingTimeMs = $body['processingTimeMs'];
$this->query = $body['query'];
$this->facetDistribution = $body['facetDistribution'] ?? [];
Expand Down
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

0 comments on commit 8d6c5f7

Please sign in to comment.