Solr: how to highlight the whole search phrase only?

前端 未结 2 1078
清歌不尽
清歌不尽 2021-01-06 22:21

A I need to perform a phrase search. On the search results Im getting the exact phrase matches but looking at the highlighted parts I see that the phrase

2条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-06 23:00

    The parameter that needed to be inserted was hl.q which basically means "I want this phrase to be highlighted" and hl.usePhraseHighlighter=true and hl.useFastVectorHighlighter=true

    So by adding to my original query : &hl.q="Day+1"&hl.usePhraseHighlighter=true&hl.useFastVectorHighlighter=true worked.

    for B) I changed fq = post:"day 1" OR title:"day 1" to fq = post:"day 1". I know that the latter is less from what I need be neverthless is works.

    fastVectorHighliter configuration that was used:

       
    

提交回复
热议问题