update to elasticsearch 1.2.1 

Due to api changes, the plugin was incompatible with elasticsearch 1.2.1. Refactored the plugin to work with api changes.