Indexing and deleting documents works!
Removed some unneeded code.