Elasticsearch-php error indexing documents

Hi,

I have elasticsearch-php code to index documents. Until now that works perfect but now i'm having error when try to index document.

This is the error:

Fatal error: Uncaught Elasticsearch\Common\Exceptions\BadRequest400Exception: {"error":"Incorrect HTTP method for uri [/hemeroteka/pdf/?pipeline=hemeroteka] and method [PUT], allowed: [POST]","status":405} in /var/www/web/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Connections/Connection.php:615

This is my php code to index:

 $client = Elasticsearch\ClientBuilder::create()->build();
 $params = [
  'index' => 'hemeroteka',
  'type'  => 'pdf',
  'id'    => $name,
  'pipeline' => 'hemeroteka',
  'body' => [
      'data'        => $base64,
      'publi' => $publi,
      'sek'     => $sek,
  ]
];
$response = $client->index($params);

What do you think is happening?

Thanks,

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.