fix delete of are document
add test for clearIndex method
fix clearIndex
improve test