get_id_index function

For each row of the data.frame main.data, find the index of the matching element in vector ids