How to prevent solr from highlighting unmatched terms?

五迷三道 提交于 2019-12-11 03:18:39

问题


I have a complex query with several terms "OR"d together. I am getting the correct documents returned, but the highlights include the terms which did not match. For example, a query like this:

text: (cat OR (dog AND ohio))

will match documents containing "cat" but not "ohio". The problems is that it will highlight "dog" in that document even though "dog" only appears in the "dog AND ohio" clause, which does not match the current document.

Is there some way to restrict the highlighter to only highlight terms from successfully matched clauses?

来源:https://stackoverflow.com/questions/26913854/how-to-prevent-solr-from-highlighting-unmatched-terms

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