Hi,
I think your Index entity would only need the CategoryId, because then based on that CategoryId you could reach the Specialty.
Then the joins would be like this:
Specialty.Id = Category.SpecialtyId
Category.Id = Index.CategoryId
This would mean that a Specialty would be in a relationship 1-to-many with Categories and Categories would be in relationship 1-to-many with Indexs.
Is this what you want to achieve? it seems right based on the values you say you want to enter!
Tell me if this helps! Cheers,
Paulo