script for elasticsearch index and type