Import some second-hand ElasticSearch code.