add function to synchronize mongo db with elasticsearch