This is the desired scenario:

User searches for something and if that something comes from a particular list, swap out the Search Result title(link), with the list item's Url field.

If the search finds results from any other list, remove it from the results.

Is this possible? Thanks.

有帮助吗?

解决方案

You can use following query to get the result

path:"https://siteurl"  (ListID:{CC6FB9E2-92CE-444E-85C7-2E126DFF9ED0} OR contentclass<>SPListItem OR)

The above query will give you all results which are not of type SPListItem. If you observe there is an OR condition where we are including search results from a single list. So in your case you should change the GUID to the guid of your list.

Before you modify DisplayTemplate, you should include the Managed Property for Url using mso:ManagedPropertyMapping

http://blogs.technet.com/b/sharepoint_quick_reads/archive/2013/08/01/sharepoint-2013-customize-display-template-for-content-by-search-web-part-cswp-part-1.aspx

许可以下: CC-BY-SA归因
scroll top