# Using multiple indices for ElasticSearch Spark plugin throws a curious warning

**URL:** <https://discuss.elastic.co/t/using-multiple-indices-for-elasticsearch-spark-plugin-throws-a-curious-warning/42594>\
**Category:** Elasticsearch\
**Tags:** es-hadoop\
**Created:** [February 24, 2016, 2:21pm UTC](https://discuss.elastic.co/t/using-multiple-indices-for-elasticsearch-spark-plugin-throws-a-curious-warning/42594 "2016-02-24T14:21:30Z")\
**Posts on this page:** 3\
**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, 2:21pm UTC](https://discuss.elastic.co/t/using-multiple-indices-for-elasticsearch-spark-plugin-throws-a-curious-warning/42594/1 "2016-02-24T14:21:30Z")

</div>

I am using ES Spark plugin and reading multiple indices...

```
sparkContext.esJsonRDD("index1, index2")

```

gives me

```
WARN RestRepository: Read resource [index1,index2/] includes multiple indices or/and aliases; to avoid duplicate results (caused by shard overlapping), parallelism is reduced from 2 to 1

```

It does not have any problem running the application, but I am wondering what exactly does the warning mean?  
Could anyone explain about this warning?

---

<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:33am UTC](https://discuss.elastic.co/t/using-multiple-indices-for-elasticsearch-spark-plugin-throws-a-curious-warning/42594/2 "2016-03-03T09:33:32Z")

</div>

It is a warning. The reason behind it has to do with how the indices shards are spread across the various nodes and how ES can select data. Currently ES does not allow one to refer to multiple indices in a query yet select only one shard from a given index (and not all of them) - hence why ES-Hadoop behind the scenes tries the various combinations and in case, there isn't one, falls back to reduced parallelism.

---

<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:26pm UTC](https://discuss.elastic.co/t/using-multiple-indices-for-elasticsearch-spark-plugin-throws-a-curious-warning/42594/3 "2017-07-06T13:26:02Z")

</div>


