Skip to content
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

Merged

Conversation

@alexander-schranz alexander-schranz added Adapter: Algolia Algolia Adapter related issue DX Improves the developer experience labels Aug 20, 2024
@alexander-schranz alexander-schranz force-pushed the feature/algolia-v4-upgrade branch from 61983ee to 67dec8c Compare September 14, 2024 11:31
@@ -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",
Copy link
Member Author

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

@alexander-schranz alexander-schranz force-pushed the feature/algolia-v4-upgrade branch from 67dec8c to 8a124de Compare September 14, 2024 11:32
@alexander-schranz alexander-schranz force-pushed the feature/algolia-v4-upgrade branch from 8a124de to d4595a6 Compare September 14, 2024 11:33

$batchIndexingResponse = $searchIndex->saveObject(
$this->marshaller->marshall($index->fields, $document),
['objectIDKey' => $identifierField->name],
Copy link
Member Author

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
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

workaround for objectIDKey v4

@alexander-schranz alexander-schranz marked this pull request as ready for review September 14, 2024 13:57
@alexander-schranz alexander-schranz merged commit 72f6f3b into PHP-CMSIG:0.5 Sep 14, 2024
32 checks passed
@alexander-schranz alexander-schranz deleted the feature/algolia-v4-upgrade branch September 14, 2024 14:04
@alexander-schranz alexander-schranz mentioned this pull request Sep 14, 2024
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Adapter: Algolia Algolia Adapter related issue DX Improves the developer experience
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant