问题
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