Sorting type updates the position index. If a traveller chose sorting by Best, itinerary indexes are sorted by Best. If sorted by price, then indexes reflect itineraries sorted from the cheapest to the most expensive one. If some other filter is applied (e.g. by airline), itinerary positions and indexes won't be changed.