Page MenuHomePhabricator

Port/fork newer versions of ruflin/Elastica to opensearch
Open, Needs TriagePublic

Description

Newer versions (>= 8) of ruflin/Elastica might no longer be compatible with OpenSearch that CirrusSearch relies on and we might need to fork/port this library to support it.

https://packagist.org/packages/ruflin/elastica#8.0.0
https://packagist.org/packages/ruflin/elastica#8.1.0
https://packagist.org/packages/ruflin/elastica#8.2.0

https://github.com/ruflin/Elastica/releases/tag/9.0.0

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

8.2 will get us PHP 8.5 support, which we should probably create a tag/board for.

We might not be able to upgrade elastica, as it won't support OpenSearch. We might have to fork elastica and work ourselves on PHP8.x support

Or do we want to look at moving to https://github.com/opensearch-project/opensearch-php... As it's a fork (of the PHP library too? The wording is vague), I'd presume it's not diverged too much...

Or do we want to look at moving to https://github.com/opensearch-project/opensearch-php... As it's a fork (of the PHP library too? The wording is vague), I'd presume it's not diverged too much...

Indeed we will have to depend on opensearch-php instead of elasticsearch-php but we still need to somewhat fork Elastica I'm afraid since it contains some DSL we rely on.

@Reedy, we try to prioritise this: Would you know if not migrating would contradict any updates (PHP?) that require a higher version of Elastica?

I don't believe that these packages block any upgrade currently, yet... As to when we upgrade past 8.3 (8.4? 8.5?) this may become more of an issue.

https://packagist.org/packages/ruflin/elastica#7.3.2 says php: ^7.2 || ^8.0... So we're probably ok on this for the moment (until PHP 9? Maybe?). We might need to upstream some bug reports/fixes if we start seeing some logspam; it's likely necessary backports haven't happened.

7.x is still maintained upstream, so that shouldn't be too much of an issue.

https://github.com/ruflin/Elastica/releases/tag/9.0.0 explicitly says PHP 8.5 support, but no apparent functional changes in the linked patch.

Same for https://github.com/ruflin/Elastica/releases/tag/8.2.0 actually...

dcausse renamed this task from Upgrade ruflin/elastica to >= 8.2 in Elastica to Port/fork newer version of ruflin/elastica to opensearch.Oct 23 2025, 5:02 PM
dcausse renamed this task from Port/fork newer version of ruflin/elastica to opensearch to Port/fork newer versions of ruflin/Elastica to opensearch.
dcausse updated the task description. (Show Details)