I'm trying to highlight searched keyword in matched document with some custom works. Therefore, I need to know position (or offset) of that keyword in document. However, I found no documentation showing clearly how to do that. I know that when set "index_options" to "offsets" or "term_vector" to "with_positions_offsets", position for token will be generated and is stored together with token, but I don't know how to fetch those values.
Please give me some suggestions. Any help would be appreciated!