Currently there exists ByPropertyIdArray in DataModel which does the indexing and is quite complicated as well as almost not maintainable. It also has several other issues, so getting rid of this class is one of the goals of this task.
Furthermore, it will be easier in the ui and api to have an index for each property id and then indices within each per-property group.
Note: Properties should be sorted by their rank automatically, which makes the whole thing a bit more complicated.