create base adapter logic for elasticsearch #1