Sitecore 7 highlight search results

感情迁移 提交于 2019-12-11 11:54:01

问题


I am working on the upgrade of a project from Sitecore 6.2 to Sitecore 7.

I have found out that in Sitecore 6.2, the highlighting of the search results are implemented with the Lucene.Net.Search.Highlight.Highlighter, QueryScorer and Formatter classes in sitecore.client dll.

Which classes and/or functions does Sitecore 7 provide to do highlighting in search results? I searched the web but I could not find the required information/examples.


回答1:


Highlighting of results is not supported currently OOTB with Sitecore 7 (it will be coming in a later version). The issue is that we map the results back to objects using the DocumentMapper so you do not have raw access to the 'Document' objects like the older versions.

For now, if you want to dig into Lucene and get the results yourself you can find the Highlighting functionality inside the Lucene.net contrib library.

If you do use this there is a useful blog post here regarding Lucene DLL versions that you should be aware of:

http://laubplusco.net/sitecore-7-lucen-3-0-highlighted-results/




回答2:


I'm not sure if is possible to hightlight in search results. On this link you can see: This little beauty is a hidden gem within the LINQ layer and in future versions of Sitecore will be your gateway to getting Highlighted Terms, Spelling Suggestions etc.



来源:https://stackoverflow.com/questions/20331760/sitecore-7-highlight-search-results

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