Querying an empty, dynamically sharded index won't work (Lucene + Elasticsearch)

Description

With Lucene, you'll get a NullPointerException.
I didn't test with Elasticsearch, but from the code I expect our code to query every index, including those not targeted by the query.

See attached patch for a testcase.

Environment

None

Assignee

Yoann Rodière

Reporter

Yoann Rodière

Labels

None

Suitable for new contributors

None

Feedback Requested

None

Components

Fix versions

Affects versions

Priority

Major
Configure