move index writing to IndexWriter class
WatcherThread: create IndexWriter once