Update for elasticsearch: build JSON with XContentBuilder.
Merge remote-tracking branch 'origin/master'
Fix compilation errors.