added option to persist data to elasticsearch