Error 500 : localhost can't handle request

I enabled error on php and this was the message returned.

Array ( [took] => 1 [timed_out] => [_shards] => Array ( [total] => 10 [successful] => 10 [failed] => 0 ) [hits] => Array ( [total] => 0 [max_score] => [hits] => Array ( ) ) )

this is my code

<?php require 'vendor/autoload.php'; $hosts = [ 'http://localhost:9200/', ]; $client = Elasticsearch\ClientBuilder::create() ->setHosts($hosts) ->build(); $params = [ 'index' => 'test', 'body' => [ 'query' => [ 'match' => [ 'title' => 'fish', ] ] ] ]; $response = $client->search($params); print_r($response);

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