Fixed index creation and deletion by explicitly refreshing index after indexing text documents