【发布时间】:2012-10-06 21:52:10
【问题描述】:
从 Lucene 搜索结果中提取词条位置的最佳方法是什么?
我正在使用带有自定义分析器的 Lucene 4.0,并尝试在每个文档中定位给定术语的每次出现。
一种选择是使用来自 Lucene 的高亮模块的代码。我还发现了问题:Finding the position of search hits from Lucene 但解决方案仅适用于以前版本的 Lucene。
除了 Lucene 4 中的荧光笔还有其他可能吗?
【问题讨论】:
-
我在这里发布了 lucene 5.2.1 的解决方案:stackoverflow.com/questions/1311199/…