-
-
Notifications
You must be signed in to change notification settings - Fork 21
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
Upgrade Algolia package to V4 #414
Upgrade Algolia package to V4 #414
Conversation
61983ee
to
67dec8c
Compare
@@ -29,7 +29,7 @@ | |||
"require": { | |||
"php": "^8.1", | |||
"schranz-search/seal": "^0.5", | |||
"algolia/algoliasearch-client-php": "^3.3", | |||
"algolia/algoliasearch-client-php": "^4.4", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
version 4.4 supports again existIndex method
67dec8c
to
8a124de
Compare
8a124de
to
d4595a6
Compare
|
||
$batchIndexingResponse = $searchIndex->saveObject( | ||
$this->marshaller->marshall($index->fields, $document), | ||
['objectIDKey' => $identifierField->name], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this seems currently not supported in v4
@@ -40,36 +40,45 @@ public function save(Index $index, array $document, array $options = []): TaskIn | |||
{ | |||
$identifierField = $index->getIdentifierField(); | |||
|
|||
$searchIndex = $this->client->initIndex($index->name); | |||
$document = $this->marshaller->marshall($index->fields, $document); | |||
$document['objectID'] = $document[$identifierField->name]; // TODO check objectIDKey instead see: https://github.com/algolia/algoliasearch-client-php/issues/738 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
workaround for objectIDKey v4
See also: https://www.algolia.com/doc/libraries/php/v4/upgrade/
Issues: