elasticsearch/elasticsearch — pull request #4234 by spinscale (2013-11-23 08:47:06+00:00)
Title: Preference only_node with unknown nodeId returns useful exception

When the search preference is set to only node, but this node is not a
data (or does not exist), we return a search exception, which indicates,
that this is actually a server problem.

However specifying a non-existing node id is a client problem
and should return a more useful error message than
{"error":"SearchPhaseExecutionException[Failed to execute phase [query_fetch], all shards failed]","status":503}

I am not a hundred percent sure, if this introduces some sort of special handling again and we should drop it therefore, but I think it improves the user experience by knowing what is going on.