在 lucene.net 中查找搜索词的偏移量,c#
我怎样才能获得必须在 Lucene.net 中搜索的标记的偏移量?我正在使用 FastVectorhighlighter 来突出显示文本?
注意:我已经获得了使用标准分析器索引的所有令牌的偏移量,现在我有兴趣获取特定令牌的偏移量吗?
testhighlighter tst = new testhighlighter();
Lucene.Net.Analysis.Token net = tokenstream.Next();
int startoffset = net.StartOffset();
int endoffset = net.EndOffset();
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();
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以尝试 TermVectorMapper 来获取项的位置和偏移量。
http://permalink.gmane.org/gmane.comp.jakarta .lucene.net.user/3203
You can try TermVectorMapper to get positions and offsets of terms.
http://permalink.gmane.org/gmane.comp.jakarta.lucene.net.user/3203