Skip to content

ElasticSearch deprecation II #5486

@BernardA

Description

@BernardA

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions