Elasticsearch read and write consistency
<p>Elasticsearch doesn't have "read consistency" param (like Cassandra).
But it has "<a href="https://www.elastic.co/guide/en/elasticsearch/reference/2.4/docs-index_.html#index-consistency" rel="noreferrer">write consistency</a>" and "<a href="https://www.elastic.co/guide/en/elasticsearch/reference/2.4/docs-get.html#preference" rel="noreferrer">read preference</a>".</p>

<p>Documentation says the following about <a href="https://www.elastic.co/guide/en/elasticsearch/reference/2.4/docs-index_.html#index-consistency" rel="noreferrer">Write Consistency</a></p>

<blockquote>
  <p><strong>Write Consistency</strong><br>
  To prevent writes from taking place on the "wrong" side of a network partition, by default, index operations only succeed if a quorum (>replicas/2+1) of active shards are available. This default can be overridden on a node-by-node basis using the action.write_consistency setting. To alter this behavior per-operation, the consistency request parameter can be used.</p>
  
  <p>Valid write consistency values are one, quorum, and all.</p>
  
  <p>Note, for the case where the number of replicas is 1 (total of 2 copies of the data), then the default behavior is to succeed if 1 copy (the primary) can perform the write.</p>
  
  <p>The index operation only returns after all <strong>active</strong> shards within the replication group have indexed the document (sync replication).</p>
</blockquote>

<p>My question is about the last paragraph:</p>

<blockquote>
  <p>The index operation only returns after all <strong>active</strong> shards within the replication group have indexed the document (sync replication).</p>
</blockquote>

<p>If <code>write_consistency=quorum</code> (default) and all shards are live (no node failures, no network-partition), then:<br>
1) Does index operation return as soon as <strong>quorum of 
shards have finished indexing</strong>? (even though all shards are live/active)<br>
2) Or does index operation return when <strong>all live/active shards have finished indexing</strong>? (i.e. quorum is considered only in case of failures/timeouts)  </p>

<p>In the first case - read may be eventual-consistent (may get stale data), write is quicker.<br>
In the second case - read is consistent (as long as there are no network-partitions), write is slower (as it waits for the slower shard/node).  </p>

<p>Does anyone know how it works?</p>

<p>Another thing that I wonder about - is why the default value for '<a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-preference.html" rel="noreferrer">preference</a>' param (in get/search request) is <code>randomized</code> but not  <code>_local</code> (which must have been more efficient I suppose)</p>