switch getattr and query to use index_info api