Skip to content

Update meilisearch/meilisearch-php requirement from ^0.15 to ^0.16 #45

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
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"require": {
"php": "^7.2",
"ext-json": "*",
"meilisearch/meilisearch-php": "^0.15",
"meilisearch/meilisearch-php": "^0.16",
"symfony/filesystem": "^4.0 || ^5.0",
"symfony/property-access": "^4.0 || ^5.0",
"symfony/serializer": "^4.0 || ^5.0"
Expand Down
2 changes: 1 addition & 1 deletion src/Command/MeiliSearchImportCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ private function formatIndexingResponse(array $batch): array
$formattedResponse[$indexName] = 0;
}

$indexInstance = $this->searchClient->getIndex($indexName);
$indexInstance = $this->searchClient->index($indexName);

// Get Update status from updateID
$indexInstance->waitForPendingUpdate($apiResponse['updateId']);
Expand Down
10 changes: 5 additions & 5 deletions src/Engine.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public function remove($searchableEntities): array
$result = [];
foreach ($data as $indexName => $objects) {
$result[$indexName] = $this->client
->getIndex($indexName)
->index($indexName)
->deleteDocument(reset($objects));
}

Expand Down Expand Up @@ -148,17 +148,17 @@ public function delete(string $indexName): ?array
*
* @param string $query
* @param string $indexName
* @param array $requestOptions
* @param array $searchParams
*
* @return array
*/
public function search(string $query, string $indexName, array $requestOptions): array
public function search(string $query, string $indexName, array $searchParams): array
{
if ('' === $query) {
$query = null;
}

return $this->client->getIndex($indexName)->search($query, $requestOptions);
return $this->client->index($indexName)->rawSearch($query, $searchParams);
}

/**
Expand All @@ -172,6 +172,6 @@ public function search(string $query, string $indexName, array $requestOptions):
*/
public function count(string $query, string $indexName, array $requestOptions): int
{
return (int) $this->client->getIndex($indexName)->search($query, $requestOptions)['nbHits'];
return (int) $this->client->index($indexName)->search($query, $requestOptions)['nbHits'];
}
}
2 changes: 1 addition & 1 deletion tests/TestCase/SettingsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public function testUpdateSettings()
]
);

$settings = $this->client->getIndex('sf_phpunit__posts')->getSettings();
$settings = $this->client->index('sf_phpunit__posts')->getSettings();

$this->assertNotEmpty($settings['stopWords']);
$this->assertEquals(['a', 'an', 'the'], $settings['stopWords']);
Expand Down