Suggestion add span from index For example there Text to search is "Hello world, Hello world" Key word "Hello" .span(...,fromSecondResult) To apply span only to second occurrence and not all in text occurrence