The ignore_unavailable option should also ignore indices that are closed

PR for #6471
can we add some javadocs?