Added `doc_as_upsert` option to update api.
This option can reduce to amount of data being send to Elasticsearch.
Closes #3195
Simplified validate check