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.