Tested and working, but I had to add a type casting since the data retrieved from ES is working somehow mysteriously with types: although it's specified as long, it reads an int