Processing and indexing scripts for Elasticsearch