silverstripe / silverstripe-search-service

A service-agnostic search module for Silverstripe CMS
BSD 3-Clause "New" or "Revised" License
5 stars 18 forks source link

The Elastic App SDK is abandoned #62

Closed adrhumphreys closed 2 years ago

adrhumphreys commented 3 years ago

Getting the following warnings when installing this module (the guzzle packages are dependencies to elastic/app-search:

Package elastic/app-search is abandoned, you should avoid using it. Use elastic/enterprise-search instead.
Package guzzlehttp/ringphp is abandoned, you should avoid using it. No replacement was suggested.
Package guzzlehttp/streams is abandoned, you should avoid using it. No replacement was suggested.

The suggestion is to move to https://github.com/elastic/enterprise-search-php This sounds like it would be a smooth transition, which is mostly correct but there's a few hairballs we'll need to solve. For example we have code for updating the schema which is the following snippet:

$response = $this->getClient()->updateSchema($envIndex, $definedSchema);
$this->handleError($response);

We would now write this as:

$schemaUpdateRequest = new SchemaUpdateRequest();
$putSchema = new PutSchema($envIndex, $schemaUpdateRequest);
$response = $this->getClient()->appSearch()->putSchema($putSchema);
$this->handleError($response->asArray());

You may be looking at the above and thinking to yourself, where did $definedSchema go? Well SchemaUpdateRequest doesn't have the ability to be passed any data therefore we can't actually update the schema currently, so we could look at doing something along the lines of (haven't actually tried this yet):

foreach ($definedSchema as $k => $v) {
    $schemaUpdateRequest->{$k} = $v;
}

This feels kind of flakey, and you can also couple it with PutSchema and SchemaUpdateRequest being marked as internal classes

Perhaps we wait for the enterprise client to stabilise a bit? 🤷🏽

GuySartorelli commented 2 years ago

@chrispenny #76 has been merged and released - does that close this issue?

chrispenny commented 2 years ago

Indeed it does! Closing now.