Added overloaded method for indexDocument