Skip to content

Commit 34b5bd1

Browse files
committed
MAGE-844 Fix SearchTest
1 parent 57aa734 commit 34b5bd1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Helper/Data.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,10 @@ public function deleteObjects($storeId, $ids, $indexName)
160160
* @param int $storeId
161161
* @param array|null $searchParams
162162
* @param string|null $targetedIndex
163+
* @return array
164+
* @throws AlgoliaException
163165
* @internal This method is currently unstable and should not be used. It may be revisited ar fixed in a future version.
164166
*
165-
* @return array
166167
*/
167168
public function getSearchResult($query, $storeId, $searchParams = null, $targetedIndex = null): array
168169
{
@@ -196,7 +197,8 @@ public function getSearchResult($query, $storeId, $searchParams = null, $targete
196197
$params = array_merge($params, $searchParams);
197198
}
198199

199-
$answer = $this->algoliaHelper->query($indexName, $query, $params);
200+
$response = $this->algoliaHelper->query($indexName, $query, $params);
201+
$answer = reset($response['results']);
200202

201203
$data = [];
202204

0 commit comments

Comments
 (0)