Solr highlighting without stop-words for phrases?

雨燕双飞 提交于 2019-12-22 15:49:42

问题


I am trying to highlight results in Solr and up until now, it's been a struggle of tweaking here and there... My main concern now is that i got the highlighting phrases thing working, but if i search for something like "The World Cup At Brazil: An Unexpected Challenge"

The highlighting field will return: "World Cup Brazil: Unexpected Challenge"

I think this might be due to the stop words (my field is a 'textgen' type, btw). Is there some kind of parameter to run in the query that would return the entire field highlighted as expected? Or will i have to remove the stopwords filter in the textgen?


回答1:


This is definitely due to stopwords. Consider declaring a new fieldtype like textgen, but without the following in it's index or query analyzers:

    <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" enablePositionIncrements="true" /> 


来源:https://stackoverflow.com/questions/4670807/solr-highlighting-without-stop-words-for-phrases

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!