Fix elasticsearch adapter