Skip to content

Upgrade Algolia package to V4#414

Merged
alexander-schranz merged 3 commits intoPHP-CMSIG:0.5from
alexander-schranz:feature/algolia-v4-upgrade
Sep 14, 2024
Merged

Upgrade Algolia package to V4#414
alexander-schranz merged 3 commits intoPHP-CMSIG:0.5from
alexander-schranz:feature/algolia-v4-upgrade

Conversation

@alexander-schranz
Copy link
Copy Markdown
Member

@alexander-schranz alexander-schranz commented Aug 20, 2024

@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
"php": "^8.1",
"schranz-search/seal": "^0.5",
"algolia/algoliasearch-client-php": "^3.3",
"algolia/algoliasearch-client-php": "^4.4",
Copy link
Copy Markdown
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
Copy Markdown
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


$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
Copy Markdown
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
@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