Fixes Elasticsearch config
add post writing event for collections