add function elasticsearch