fixes to allow the index to be passed back to the search in case resource_id is not the unique key