# Missing Index 404

**URL:** <https://discuss.elastic.co/t/missing-index-404/34795>\
**Category:** Elasticsearch\
**Created:** [November 17, 2015, 11:42am UTC](https://discuss.elastic.co/t/missing-index-404/34795 "2015-11-17T11:42:08Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![rabeetwaqar](https://avatars.discourse-cdn.com/v4/letter/r/b2d939/32.png) [@rabeetwaqar](https://discuss.elastic.co/u/rabeetwaqar)\
**Post date:** [November 17, 2015, 11:42am UTC](https://discuss.elastic.co/t/missing-index-404/34795/1 "2015-11-17T11:42:08Z")

</div>

Hi,

I'm facing this issue when i updated ES to 2.0.0.  
I updated my ES PHP client to ~2.0.

Initializing client like this :

$logger = ClientBuilder::defaultLogger( **DIR**.'/es.log', Logger::INFO);  
$params = array(  
'127.0.0.1:9200'  
);

$clientBuilder = ClientBuilder::create(); // Instantiate a new ClientBuilder  
$clientBuilder-\>setHosts($params);  
$clientBuilder-\>setLogger($logger);  
$client = $clientBuilder-\>build();

But unfortunately getting this error although i have created 'testindex'. ☹

[Tue Nov 17 16:37:45.744937 2015] [:error] [pid 6400] [client 127.0.0.1:42646] PHP Fatal error: Uncaught exception 'Elasticsearch\Common\Exceptions\Missing404Exception' with message '{"found":false,"\_index":"testindex","\_type":"data","\_id":"\_query","\_version":3,"\_shards":{"total":2,"successful":1,"failed":0}}'

Thank you

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [November 17, 2015, 12:30pm UTC](https://discuss.elastic.co/t/missing-index-404/34795/2 "2015-11-17T12:30:20Z")

</div>

Not sure about what you did but here you asked to `GET` a document in index `testindex`, with type `data` and id `query`.

This document does not exist.

---

<div class="post-metadata">

**Author:** ![rabeetwaqar](https://avatars.discourse-cdn.com/v4/letter/r/b2d939/32.png) [@rabeetwaqar](https://discuss.elastic.co/u/rabeetwaqar)\
**Post date:** [November 17, 2015, 12:37pm UTC](https://discuss.elastic.co/t/missing-index-404/34795/3 "2015-11-17T12:37:19Z")

</div>

Hello,

First issue :  
I was calling :  
$aFlushParams = array();  
$aFlushParams['index'] = $index;  
$aFlushParams['type'] = $type;  
$aFlushParams['body'] = array(  
'query' =\> array(  
'match\_all' =\> array()  
)  
);  
$client-\>deleteByQuery(aFlushParams);

and getting the error above. (mentioned in above post)

Second issue :

On bulk insert :

$formattedDocument['body'] = array();

foreach ($document as $valueDoc) {

```
$formattedDocument['body'][] = array(

    'index' => array(
        '_index' => $index,
        '_type' => $type,
        '_id' => $valueDoc['id']
    )
);

$formattedDocument['body'][] = $valueDoc;

```

}  
$client-\>bulk($formattedDocument);

It works fine for 10 - 20k documents but after this it ends up throwing this below exception.

Uncaught exception 'Elasticsearch\Common\Exceptions\TransportException' with message 'cURL error 56: Recv failure: Connection reset by peer'

Any work around for this? Or do i need to reconnect to ES and send data in chunks?

Thank you

---

<div class="post-metadata">

**Author:** ![polyfractal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/polyfractal/32/48162_2.png) [@polyfractal](https://discuss.elastic.co/u/polyfractal)\
**Post date:** [November 19, 2015, 2:54pm UTC](https://discuss.elastic.co/t/missing-index-404/34795/4 "2015-11-19T14:54:56Z")

</div>

The first issue (delete by query) is because that API has been removed from core Elasticsearch in 2.0. It is now a plugin, see: [https://www.elastic.co/blog/core-delete-by-query-is-a-plugin](https://www.elastic.co/blog/core-delete-by-query-is-a-plugin)

Regarding the second issue, it sounds like a problem with your cluster and not the client. You don't need to reconnect the client between operations, it manages all of that for you.

Can you add the logs from your ES node/cluster? Perhaps there is a clue in there about what's going wrong?

---

<div class="post-metadata">

**Author:** ![rabeetwaqar](https://avatars.discourse-cdn.com/v4/letter/r/b2d939/32.png) [@rabeetwaqar](https://discuss.elastic.co/u/rabeetwaqar)\
**Post date:** [November 20, 2015, 6:44am UTC](https://discuss.elastic.co/t/missing-index-404/34795/5 "2015-11-20T06:44:42Z")

</div>

Hello,

Thanks for letting me know.

I fixed that issue by sending data in chunks. cheers 😉

---

<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:** [July 5, 2017, 11:37pm UTC](https://discuss.elastic.co/t/missing-index-404/34795/6 "2017-07-05T23:37:01Z")

</div>


