Add index function to engine