# Elasticsearch new client builder was created but not working on search, index and all other queries

**URL:** <https://discuss.elastic.co/t/elasticsearch-new-client-builder-was-created-but-not-working-on-search-index-and-all-other-queries/126301>\
**Category:** Elasticsearch\
**Created:** [March 31, 2018, 5:05am UTC](https://discuss.elastic.co/t/elasticsearch-new-client-builder-was-created-but-not-working-on-search-index-and-all-other-queries/126301 "2018-03-31T05:05:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![divya757](https://avatars.discourse-cdn.com/v4/letter/d/3be4f8/32.png) [@divya757](https://discuss.elastic.co/u/divya757)\
**Post date:** [March 31, 2018, 5:05am UTC](https://discuss.elastic.co/t/elasticsearch-new-client-builder-was-created-but-not-working-on-search-index-and-all-other-queries/126301/1 "2018-03-31T05:05:24Z")

</div>

i am working on aws elasticsearch 6.2 and laravel framework

my code

$hosts=[  
'host' =\> 'localhost(here i am using aws end point)'  
// Only host is required  
];

```
 $client = ClientBuilder::create() // Instantiate a new ClientBuilder
            ->setHosts($hosts) // Set the hosts
            ->build();        
 dump($client);

```

$json = '{  
"query" : {  
"match" : {  
"title" : "phone"  
}  
}  
}';

$params['index'] = 'sainikad';  
$params['type'] = 'ads';  
$params['body'] = $json;

$results=$client-\>search($params);

the error i was getting is

Symfony\Component\Debug\Exception\FatalErrorException: Maximum execution time of 30 seconds exceeded in C:\xampp\htdocs\sainik\vendor\guzzlehttp\ringphp\src\Client\CurlHandler.php:90

and dump clientbuilder was getting response as

Client {#419 ▼  
+transport: Transport {#417 ▶}  
#params: null  
#indices: IndicesNamespace {#420 ▶}  
#cluster: ClusterNamespace {#421 ▶}  
#nodes: NodesNamespace {#422 ▶}  
#snapshot: SnapshotNamespace {#423 ▶}  
#cat: CatNamespace {#424 ▶}  
#ingest: IngestNamespace {#425 ▶}  
#tasks: TasksNamespace {#426 ▶}  
#remote: RemoteNamespace {#427 ▶}  
#endpoints: Closure {#418 ▶}  
#registeredNamespaces: []  
}

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [April 28, 2018, 5:05am UTC](https://discuss.elastic.co/t/elasticsearch-new-client-builder-was-created-but-not-working-on-search-index-and-all-other-queries/126301/2 "2018-04-28T05:05:42Z")

</div>

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