Code changes caused by elasticsearch v1.0.0 upgrade