Just display all the indexes that contain the word in the order of the word. A front-end can differentiate order based on array order.