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

Elasticsearch namespace reference error #6788

Open
latenzio opened this issue Nov 12, 2024 · 3 comments · May be fixed by #6827
Open

Elasticsearch namespace reference error #6788

latenzio opened this issue Nov 12, 2024 · 3 comments · May be fixed by #6827

Comments

@latenzio
Copy link

API Platform version(s) affected: 4.0.8

Description
Elasticsearch Support is restricted to elasticsearch/elasticsearch:^7.11.
But in f.e. ApiPlatform\Elasticsearch\State\CollectionProvider the namespace for the Elasticsearch Client from elasticsearch/elasticsearch:^8 seems to be used.

How to reproduce

Possible Solution
Maybe I'm erroneous - I think this has to be changed to the Elasticsearch\Client namespace.

Additional Context

@darthf1
Copy link
Contributor

darthf1 commented Nov 25, 2024

Got the same issue. To summarize:

Was there a specific reason to drop ES7 compatibility in APIP 4? ES7 is not EOL. Support in apip was removed in this commit.

My tests currently fail with:

ApiPlatform\\Elasticsearch\\State\\ItemProvider::__construct(): Argument #1 ($client) must be of type Elastic\\Elasticsearch\\Client, Elasticsearch\\Client given

@soyuka
Copy link
Member

soyuka commented Nov 26, 2024

We don't have the resources nor the time to maintain ES7 but you can always reintroduce its support in 4.x by adding the correct provider no?

@darthf1
Copy link
Contributor

darthf1 commented Nov 26, 2024

Yes that is absolutely possible.

Would you accept a PR reintroducing ES7 compat? I think only the namespace to the v7 client has to be reintroduced; but I'll find out.

Also; I can install api-platform/core:4.0.10 alongside elasticsearch/elasticsearch:7.17.2, but with api-platform/elasticsearch:4.0.10, I cannot.

Problem 1
  - Root composer.json requires api-platform/elasticsearch 4.0.10 -> satisfiable by api-platform/elasticsearch[v4.0.10].
  - api-platform/elasticsearch v4.0.10 requires elasticsearch/elasticsearch ^8.4 -> found elasticsearch/elasticsearch[v8.4.0, ..., v8.16.0] but it conflicts with your root composer.json require (7.17.2).

Only a custom provider wont do in this case, since I also would like to make use of the filters in the apip/es package.

@darthf1 darthf1 linked a pull request Nov 26, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants