[DOCS] fix typo
Update function-score-query.asciidoc
[Tests] SimpleRecoveryLocalGatewayTests.testSingleNodeNoFlush could fail if shards were not started

The test starts a single node, indexes into, restarts the node and checks that no data was lost. It only indexed into 2 shards and didn't wait for green meaning that the node could be restarted with non-started primary. In that case the node will not re-assign the primary as it was not started. This commit makes sure that we either wait for primaries to start or index into all shards which has the same net effect.

Also extending some logging in InternalIndexShard.
A new ClusterStateStatus to indicate cluster state life cycles

When the ClusterService applies a new cluster state, it is first assigned as the new active one and then all listeners are called. Some of ES's features sample the current state and try to take action on it (for example index a document). If that fails, they will wait for change in the cluster state and try again (for example, wait for a shard to start and try indexing again).

If you're unlucky you sample the state after it has been assigned as the "active" state but before all listeners has done the work. In this cases the action take (i.e., indexing a doc) will still fail (as the shard is not yet started) but waiting for a new state may take a long time or fail.

 This commit adds a new ClusterStateStatus that allows to better track the stages a cluster state goes through (currently `RECEIVED`, `BEING_APPLIED` & `APPLIED`). This allows detecting that a cluster state is not yet fully applied and retry without waiting for a new state to arrive.

 This commits also adds a utility class , ClusterStateObserver, to make this pattern slightly simpler and avoid common pit falls.
Feedback round + some cleanup
Added ObservingContext to unify access to a couple of observing related variables.
minor tweak to make the code more readable
Bundeled lastObservedState and lastObservedStatus into a single class
Sampled wrong cluster state when evaluating change (though shouldn't be a problem). Add logging.
Missing return at ClusterStateObserver.ValidationPredicate.apply

Also added more logging
Added more logging to SimpleFacetTests
Removed trace logs and added progress logs.
extra fix after rebasing