unit test for retrieveindexfields.