Code for creating index from tweets.