More changes to elasticsearch stuff before branch merge