generalize indexin definition
Merge pull request #7086 from Jutho/jh/indexinfix

generalize indexin definition