【发布时间】:2014-07-30 01:17:09
【问题描述】:
我有一个基本的搜索工作,我正在使用FastVectorHighlighter 突出显示。当您向荧光笔询问“最佳片段”时,您有一些 getBestFragment(s) 的重载可供选择,documented here。我现在用的是最简单的,像这样:
highlightedText = highlighter.getBestFragment(fieldQuery, searcher.getIndexReader(),
scoreDoc.doc, "description", 100)
所以我在“描述”字段中突出显示匹配项。然而,我的查询搜索另一个字段“注释”。如何将其包含在突出显示中?有一个重载需要一个Set<String> matchedFields 和一个String storedField,但我不理解文档。该方法的文档说:
建议所有matchedFields 与storedField 共享相同的源或至少是它的前缀。
这是什么意思?如何索引“notes”和“description”字符串,matchedFields 和 storedField 传递什么?
【问题讨论】: