Code to maintain and access indices.