# Es.index.read.missing.as.empty seems not working with multiple indices?

**URL:** https://discuss.elastic.co/t/es-index-read-missing-as-empty-seems-not-working-with-multiple-indices/42612
**Category:** Elasticsearch
**Tags:** es-hadoop
**Created:** [February 24, 2016, 4:24pm UTC](https://discuss.elastic.co/t/es-index-read-missing-as-empty-seems-not-working-with-multiple-indices/42612 "2016-02-24T16:24:22Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![dynamicscope](https://avatars.discourse-cdn.com/v4/letter/d/e9bcb4/32.png) [@dynamicscope](https://discuss.elastic.co/u/dynamicscope)
#### Post date: [February 24, 2016, 4:24pm UTC](https://discuss.elastic.co/t/es-index-read-missing-as-empty-seems-not-working-with-multiple-indices/42612/1 "2016-02-24T16:24:22Z")

</div>

I am using ES Hadoop Spark plugin.

I have set and am running the following...

```
val conf = new SparkConf()
  .setAppName(this.getClass.getSimpleName)
  .set("spark.app.id", "1")
  .set("es.nodes", ConfigHelper.elasticHost)
  .set("es.index.read.missing.as.empty", "yes")
val sc = new SparkContext(conf)

sc.esJsonRDD("index1, index2", queryString)
...

```

And it throws

```
[index2] IndexNotFoundException[no such index]
	at org.elasticsearch.cluster.metadata.IndexNameExpressionResolver$WildcardExpressionResolver.resolve(IndexNameExpressionResolver.java:586)
	at org.elasticsearch.cluster.metadata.IndexNameExpressionResolver.concreteIndices(IndexNameExpressionResolver.java:133)
	at org.elasticsearch.cluster.metadata.IndexNameExpressionResolver.concreteIndices(IndexNameExpressionResolver.java:113)
	at org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.<init>(TransportSearchTypeAction.java:121)
	at org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction$AsyncAction.<init>(TransportSearchQueryThenFetchAction.java:73)
	at org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction$AsyncAction.<init>(TransportSearchQueryThenFetchAction.java:67)
	at org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction.doExecute(TransportSearchQueryThenFetchAction.java:64)
	at org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction.doExecute(TransportSearchQueryThenFetchAction.java:53)
	at org.elasticsearch.action.support.TransportAction.execute(TransportAction.java:70)
	at org.elasticsearch.action.search.TransportSearchAction.doExecute(TransportSearchAction.java:99)
	at org.elasticsearch.action.search.TransportSearchAction.doExecute(TransportSearchAction.java:44)
	at org.elasticsearch.action.support.TransportAction.execute(TransportAction.java:70)
	at org.elasticsearch.action.support.HandledTransportAction$TransportHandler.messageReceived(HandledTransportAction.java:45)
	at org.elasticsearch.action.support.HandledTransportAction$TransportHandler.messageReceived(HandledTransportAction.java:41)
	at org.elasticsearch.transport.netty.MessageChannelHandler.handleRequest(MessageChannelHandler.java:244)
	at org.elasticsearch.transport.netty.MessageChannelHandler.messageReceived(MessageChannelHandler.java:114)
	at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70)
	at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
	at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791)
	at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:296)
	at org.jboss.netty.handler.codec.frame.FrameDecoder.unfoldAndFireMessageReceived(FrameDecoder.java:462)
	at org.jboss.netty.handler.codec.frame.FrameDecoder.callDecode(FrameDecoder.java:443)
	at org.jboss.netty.handler.codec.frame.FrameDecoder.messageReceived(FrameDecoder.java:303)
	at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70)
	at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
	at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791)
	at org.elasticsearch.common.netty.OpenChannelsHandler.handleUpstream(OpenChannelsHandler.java:75)
	at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
	at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:559)
	at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:268)
	at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:255)
	at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:88)
	at org.jboss.netty.channel.socket.nio.AbstractNioWorker.process(AbstractNioWorker.java:108)
	at org.jboss.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:337)
	at org.jboss.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:89)
	at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:178)
	at org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108)
	at org.jboss.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:42)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)

```

Weird...  
Wouldn't `("es.index.read.missing.as.empty", "yes")` make it not throwing the exception?  
I've even tried with `("es.index.read.missing.as.empty", "true")`, and it throws the same.

Any idea?

---

<div class="post-metadata">

### Author: ![costin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/costin/32/44950_2.png) [@costin](https://discuss.elastic.co/u/costin)
#### Post date: [March 3, 2016, 9:35am UTC](https://discuss.elastic.co/t/es-index-read-missing-as-empty-seems-not-working-with-multiple-indices/42612/2 "2016-03-03T09:35:26Z")

</div>

Do you get the exception with your spark app or not? The setting is only available in ES-Hadoop to make it ignore non-existing indices.

---

<div class="post-metadata">

### Author: ![dynamicscope](https://avatars.discourse-cdn.com/v4/letter/d/e9bcb4/32.png) [@dynamicscope](https://discuss.elastic.co/u/dynamicscope)
#### Post date: [March 3, 2016, 12:08pm UTC](https://discuss.elastic.co/t/es-index-read-missing-as-empty-seems-not-working-with-multiple-indices/42612/3 "2016-03-03T12:08:45Z")

</div>

The exception comes from the following line of code.

```
sc.esJsonRDD("index1, index2", queryString)

```

Isn't this from ES-Hadoop?

---

<div class="post-metadata">

### Author: ![costin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/costin/32/44950_2.png) [@costin](https://discuss.elastic.co/u/costin)
#### Post date: [March 3, 2016, 12:09pm UTC](https://discuss.elastic.co/t/es-index-read-missing-as-empty-seems-not-working-with-multiple-indices/42612/4 "2016-03-03T12:09:45Z")

</div>

It does - wanted to verify. Can you please raise an issue - it looks like a bug. Thanks!

---

<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 6, 2017, 1:25pm UTC](https://discuss.elastic.co/t/es-index-read-missing-as-empty-seems-not-working-with-multiple-indices/42612/5 "2017-07-06T13:25:56Z")

</div>


