Finding offsets of a search term in lucene.net,c#
问题 How could I get offsets for the tokens that has to be searched in Lucene.net?I am using FastVector Highlighter for highlighting a text? Note :I have already got the offsets of all the token that has been indexed using Standard Analyzer and now I would be interested in getting the offsets of the particular token? testhighlighter tst = new testhighlighter(); Lucene.Net.Analysis.Token net = tokenstream.Next(); int startoffset = net.StartOffset(); int endoffset = net.EndOffset(); 回答1: You can try