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 deprecation II #5486

Closed
BernardA opened this issue Mar 22, 2023 · 3 comments
Closed

ElasticSearch deprecation II #5486

BernardA opened this issue Mar 22, 2023 · 3 comments
Labels

Comments

@BernardA
Copy link

API Platform version(s) affected: 3.1.3

Description

According to this issue, the deprecated elasticsearch option under ApiResource is replaced by setting the provider in the operation as so:

new Get(provider: ItemProvider::class)

That does not seem to prevent a warning. In the case below, the entity SocieteComplement is provided by Doctrine.

It will do likewise for all entities with ApiResource() that do not have a corresponding ES index as provider.

app.WARNING: Request Failure: {"method":"GET","uri":"http://localhost:9200/_cat/indices/societe_complement","port":9200,"headers":{"Host":["localhost"],"Content-Type":["application/json"],"Accept":["application/json"],"User-Agent":["elasticsearch-php/7.17.1 (WINNT 10.0; PHP 8.2.2)"],"x-elastic-client-meta":["es=7.17.1,php=8.2.2,t=7.17.1,a=0,cu=7.85.0"]},"HTTP code":404,"duration":0.001982,"error":"{"error":{"root_cause":[{"type":"index_not_found_exception","reason":"no such index [societe_complement]","resource.type":"index_or_alias","resource.id":"societe_complement","index_uuid":"na","index":"societe_complement"}],"type":"index_not_found_exception","reason":"no such index [societe_complement]","resource.type":"index_or_alias","resource.id":"societe_complement","index_uuid":"na","index":"societe_complement"},"status":404}"} []
[2023-03-22T15:49:37.660584+01:00] app.WARNING: Response ["{"error":{"root_cause":[{"type":"index_not_found_exception","reason":"no such index [societe_complement]","resource.type":"index_or_alias","resource.id":"societe_complement","index_uuid":"na","index":"societe_complement"}],"type":"index_not_found_exception","reason":"no such index [societe_complement]","resource.type":"index_or_alias","resource.id":"societe_complement","index_uuid":"na","index":"societe_complement"},"status":404}"] []

How to reproduce

Do not include de elasticsearch: false option on `ApiResource(). Of course, if you do include that option you will have the deprecation warning.

Possible Solution

Additional Context

@dannyvw
Copy link
Contributor

dannyvw commented Mar 22, 2023

The fix from the issue is available in 3.1.5. Can you update and check again?

Created an extra PR (#5499) because is it not completly fixed.

@BernardA
Copy link
Author

Thanks @dannyvw . Will do soon as I am able to move to 3.1.5

@stale
Copy link

stale bot commented May 30, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label May 30, 2023
@stale stale bot closed this as completed Jun 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants