Solr突出显示停用词

时间:2012-11-10 23:52:11

标签: solr highlighting stop-words

schema.xml(与我的问题相关的部分):

<field name="question" stored="true" type="text" multiValued="false" indexed="true"/>
<field name="question_highlight" stored="true" type="string" multiValued="false" indexed="true"/>
</fields>
<!-- AND -->
<copyField source="question" dest="question_highlight" />

注意:我为 fieldType:text

启用了停用词

当我索引文档时,我通过了问题字段 现在,当我尝试使用此查询进行搜索时

select?q=question:have fever&hl=true&hl.fl=question_highlight

知道 这个词包含在我的停用词列表中, 一词未在结果中突出显示 我怎样才能解决这个问题?我需要突出显示停用词,我查看了这篇文章Solr highlighting without stop-words for phrases?这就是为什么我把 question_highlight 作为字符串,但它仍然无法正常工作

1 个答案:

答案 0 :(得分:0)

简单的解决方案是在使用q on时在高亮区域上使用hl.q参数 具有StopFilter和hl.q

的搜索字段
相关问题