Indexing with elasticsearch gives warning / 404

Hey community

I am playing around with the elasticsearch integration into shopware and having some problems: I followed this guide https://docs.dockware.io/faq/elasticsearch to set up two docker containers (one for es one for the demo store).
When I try to index the dummy data provided in the demo store using this guide https://docs.shopware.com/en/shopware-platform-dev-en/how-to/using-elasticsearch I run:

  • php bin/console dal:refresh:index

as stated in the guide. Unfortunately I am getting only 404 responses in return:
15:14:18 WARNING [app] Request Failure: ["method" => "HEAD","uri" => "http://elasticsearch/abc_product_2fbb5fe2e29a4d70aa5854ce7ce3e20b","headers" => ["Host" => ["elasticsearch"],"Content-Type" => ["application/json"],"Accept" => ["application/json"],"User-Agent" => ["elasticsearch-php/7.2.2 (Linux 4.19.121-linuxkit; PHP 7.4.15)"]],"HTTP code" => 404,"duration" => 0.002015,"error" => "null"] 15:14:18 WARNING [app] Response [null]

I’ve declared the env variables as required and they are being recognized (which can be seen by the prefix ‚abc‘ in the uri). Not sure what else I need to configure. Anyone have a suggestion?

best
Adrian

You can ignore the error. This happens cause the index is not existing

Hey man, first of all: thanks for answering to my thread! I appreciate it. Will look into why the index doesn’t exist yet next.

Regards,
Adrian

You can check it with curl es-host:9200/_indices

Ok so apparently you need to run all of the three commands including

php bin/console es:create:alias

before the index is created. Not sure why this is the case but it after I can access the es index via the API

I am so happy to see that the issue have been solved, keep sharing this type of post. Looking for the same issue.

Thanks again

Kroger Feed