Skip to content

Commit ce0af08

Browse files
committed
Update code to the v0.16.0 version of meilisearch-php
1 parent 404282d commit ce0af08

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/Command/MeiliSearchImportCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ private function formatIndexingResponse(array $batch): array
182182
$formattedResponse[$indexName] = 0;
183183
}
184184

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

187187
// Get Update status from updateID
188188
$indexInstance->waitForPendingUpdate($apiResponse['updateId']);

src/Engine.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public function remove($searchableEntities): array
106106
$result = [];
107107
foreach ($data as $indexName => $objects) {
108108
$result[$indexName] = $this->client
109-
->getIndex($indexName)
109+
->index($indexName)
110110
->deleteDocument(reset($objects));
111111
}
112112

@@ -148,17 +148,17 @@ public function delete(string $indexName): ?array
148148
*
149149
* @param string $query
150150
* @param string $indexName
151-
* @param array $requestOptions
151+
* @param array $searchParams
152152
*
153153
* @return array
154154
*/
155-
public function search(string $query, string $indexName, array $requestOptions): array
155+
public function search(string $query, string $indexName, array $searchParams): array
156156
{
157157
if ('' === $query) {
158158
$query = null;
159159
}
160160

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

164164
/**
@@ -172,6 +172,6 @@ public function search(string $query, string $indexName, array $requestOptions):
172172
*/
173173
public function count(string $query, string $indexName, array $requestOptions): int
174174
{
175-
return (int) $this->client->getIndex($indexName)->search($query, $requestOptions)['nbHits'];
175+
return (int) $this->client->index($indexName)->search($query, $requestOptions)['nbHits'];
176176
}
177177
}

tests/TestCase/SettingsTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public function testUpdateSettings()
9393
]
9494
);
9595

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

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

0 commit comments

Comments
 (0)